From 4cf9782d0056a8718e90b6ff1f055767ea23cd82 Mon Sep 17 00:00:00 2001 From: William Jamieson Date: Wed, 23 Oct 2024 13:13:52 -0400 Subject: [PATCH] Update test to cover possible errors --- gwcs/tests/test_wcs.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/gwcs/tests/test_wcs.py b/gwcs/tests/test_wcs.py index 136c32d0..7a69c853 100644 --- a/gwcs/tests/test_wcs.py +++ b/gwcs/tests/test_wcs.py @@ -441,6 +441,12 @@ def test_grid_from_compound_bounding_box(): assert np.all(grid == grid_truth) + # Capture errors + with pytest.raises(ValueError, match=r"Cannot use selector with a non-CompoundBoundingBox"): + grid_from_bounding_box(model.bounding_box[(300,)], selector=(300,)) + with pytest.raises(ValueError, match=r"selector must be set when bounding_box is a CompoundBoundingBox"): + grid_from_bounding_box(model.bounding_box) + def test_wcs_from_points(): np.random.seed(0)