From eeb7b6b0354e2f285129309acdb9d1f278476546 Mon Sep 17 00:00:00 2001 From: Jim Bosch Date: Mon, 6 Jan 2025 15:45:02 -0500 Subject: [PATCH] Fix bug in test code. Since the string literal "id" is never equal to an integer, these tests were definitely not working as intended before. --- tests/test_astrometryFail.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tests/test_astrometryFail.py b/tests/test_astrometryFail.py index 895d8b7..7052c0d 100644 --- a/tests/test_astrometryFail.py +++ b/tests/test_astrometryFail.py @@ -113,10 +113,11 @@ def testVisitCoordsAreNanForFailedAstrom(self): self.assertTrue(np.all(np.isfinite(visitTable["ra"]))) visitSummary = self.butler.get("visitSummary", self.calexpMinimalDataId) - self.assertTrue(np.isfinite(visitSummary["id" == self.detector]["astromOffsetMean"])) - self.assertTrue(np.isfinite(visitSummary["id" == self.detector]["astromOffsetStd"])) - self.assertTrue(np.all(np.isnan(visitSummary["id" == 1]["raCorners"]))) - self.assertTrue(np.all(np.isnan(visitSummary["id" == 1]["decCorners"]))) + row = visitSummary.find(self.detector) + self.assertTrue(np.isfinite(row["astromOffsetMean"])) + self.assertTrue(np.isfinite(row["astromOffsetStd"])) + self.assertTrue(np.all(np.isnan(row["raCorners"]))) + self.assertTrue(np.all(np.isnan(row["decCorners"]))) def testMetadataForFailedAstrom(self): """Test that the metadata for a failed astrometic fit is set properly.