Skip to content

Commit

Permalink
Test that we get the warning when importing old format data
Browse files Browse the repository at this point in the history
  • Loading branch information
timj committed Aug 7, 2024
1 parent 57c8956 commit 323709d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tests/test_simpleButler.py
Original file line number Diff line number Diff line change
Expand Up @@ -687,7 +687,9 @@ def testJsonDimensionRecordsAndHtmlRepresentation(self):
def test_dimension_records_import(self):
# Dimension Records
butler = self.makeButler(writeable=True)
butler.import_(filename=os.path.join(TESTDIR, "data", "registry", "hsc-rc2-subset-v0.yaml"))
with self.assertWarns(UserWarning) as cm:
butler.import_(filename=os.path.join(TESTDIR, "data", "registry", "hsc-rc2-subset-v0.yaml"))
self.assertIn("Constructing day_obs records with no timespans", str(cm.warning))

# Count records and assume this means it worked.
dimensions = (
Expand Down

0 comments on commit 323709d

Please sign in to comment.