From 7c9186c12833064a25402306b3469f9b51b1a6e8 Mon Sep 17 00:00:00 2001 From: Tim Jenness Date: Tue, 6 Aug 2024 17:26:37 -0700 Subject: [PATCH] Test that we get the warning when importing old format data --- tests/test_simpleButler.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/test_simpleButler.py b/tests/test_simpleButler.py index c74970367c..1872f14e84 100644 --- a/tests/test_simpleButler.py +++ b/tests/test_simpleButler.py @@ -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 = (