From 6839a4b33d30f4ba11f17d681599075f724128f8 Mon Sep 17 00:00:00 2001 From: Hsin-Fang Chiang Date: Mon, 30 Sep 2024 09:56:01 -0700 Subject: [PATCH] Enable prep_butler unit tests again Some unit tests were temporarily marked expectedFailure in https://github.com/lsst-dm/prompt_processing/commit/674a4b1ff63a590ea30b547bf048d34f53d57e18. Now that we switch to the new query system, make them work again. The test repo was put together using middleware tools, which intrinsically uses butler repo's visit-detector regions with its padding from defineVisits config. That padding config is not the same as the preload region padding in prompt processing. This explains the patch differences in template selection. --- tests/test_middleware_interface.py | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/tests/test_middleware_interface.py b/tests/test_middleware_interface.py index 6bf3444c..7b34389d 100644 --- a/tests/test_middleware_interface.py +++ b/tests/test_middleware_interface.py @@ -275,9 +275,8 @@ def _check_imports(self, butler, group, detector, expected_shards): # Check that the right templates are in the chained output collection. # Need to refresh the butler to get all the dimensions/collections. butler.registry.refresh() - for patch in (142, 143, 144, 158, 159, 160, 161, 175, 176, 177, 178, - # TODO DM-43712: doesn't load 179 or 196 - 179, 192, 193, 194, 195, 196, 210, 211,): + for patch in (142, 143, 158, 159, 160, 161, 175, 176, 177, 178, + 192, 193, 194, 195, 210, 211,): with self.subTest(tract=7445, patch=patch): self.assertTrue( butler.exists('goodSeeingCoadd', tract=7445, patch=patch, band="g", @@ -308,8 +307,6 @@ def _check_imports(self, butler, group, detector, expected_shards): collections=preload_collection) ) - # TODO: prep_butler doesn't grab all the refcats. Should be fixable on DM-43712 - @unittest.expectedFailure def test_prep_butler(self): """Test that the butler has all necessary data for the next visit. """ @@ -366,8 +363,6 @@ def test_prep_butler_novalid(self): mock_pre.assert_not_called() - # TODO: prep_butler doesn't grab all the refcats. Should be fixable on DM-43712 - @unittest.expectedFailure def test_prep_butler_twice(self): """prep_butler should have the correct calibs (and not raise an exception!) on a second run with the same, or a different detector.