From 9970dee9223d17b2caa85ade20fc2bfbe92e45d0 Mon Sep 17 00:00:00 2001 From: ahmadtourei Date: Thu, 19 Dec 2024 15:16:49 -0700 Subject: [PATCH] add a test to address codecov --- tests/test_examples.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/test_examples.py b/tests/test_examples.py index 07a2c79c..8ed355ac 100644 --- a/tests/test_examples.py +++ b/tests/test_examples.py @@ -73,6 +73,14 @@ def test_moveout(self): class TestDeltaPatch: """Tests for the delta_patch example.""" + @pytest.mark.parametrize("invalid_dim", ["invalid_dimension", "", None, 123]) + def test_delta_patch_invalid_dim(self, invalid_dim): + """ + Test that passing an invalid dimension value raises a ValueError. + """ + with pytest.raises(ValueError, match="The delta patch is a 2D patch"): + dc.get_example_patch("delta_patch", dim=invalid_dim) + @pytest.mark.parametrize("dim", ["time", "distance"]) def test_delta_patch_structure(self, dim): """Test that the delta_patch returns a Patch with correct structure."""