Skip to content

Commit

Permalink
exercise sim archive metadata compilation cache in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ehneilsen committed Oct 10, 2024
1 parent 3fa1ad5 commit 16bebcc
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests/sim_archive/test_sim_archive.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,13 @@

from rubin_scheduler.sim_archive.sim_archive import (
check_opsim_archive_resource,
compile_sim_metadata,
make_sim_archive_cli,
make_sim_archive_dir,
read_archived_sim_metadata,
read_sim_metadata_from_hdf,
transfer_archive_dir,
verify_compiled_sim_metadata,
)


Expand Down Expand Up @@ -96,6 +99,15 @@ def test_sim_archive(self):
expected_label = f"{base} test"
self.assertEqual(archive_metadata[sim_archive_uri.geturl()]["label"], expected_label)

# Cache the metadata
test_compiled_metadata_uri = test_resource_uri + "/compiled_metadata_cache.h5"

# Test reading from cached metadata
compile_sim_metadata(test_resource_uri, test_compiled_metadata_uri)
read_sim_metadata_from_hdf(test_compiled_metadata_uri)
read_archived_sim_metadata(test_resource_uri, compilation_resource=test_compiled_metadata_uri)
verify_compiled_sim_metadata(test_resource_uri, test_compiled_metadata_uri)

@unittest.skipIf(not HAVE_LSST_RESOURCES, "No lsst.resources")
@unittest.skipIf(importlib.util.find_spec("schedview") is None, "No schedview")
def test_cli(self):
Expand Down

0 comments on commit 16bebcc

Please sign in to comment.