Skip to content

Commit b113b84

Browse files
committed
Add test for updated edge case behaviour
1 parent b047c4c commit b113b84

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

tests/util/test_coord.py

+5
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,11 @@ def test_get_linear_interpolated_value(self):
1919
with pytest.raises(ValueError, match=r"x=6 is out of range of provided x_values \(0, 5\)"):
2020
coord.get_linear_interpolated_value(x_vals, y_vals, 6)
2121

22+
# test when x is equal to first value in x_vals (previously broke, fixed in #4299):
23+
assert coord.get_linear_interpolated_value(x_vals, y_vals, 0) == approx(3)
24+
with pytest.raises(ValueError, match=r"x=-0.5 is out of range of provided x_values \(0, 5\)"):
25+
coord.get_linear_interpolated_value(x_vals, y_vals, -0.5)
26+
2227
def test_in_coord_list(self):
2328
coords = [[0, 0, 0], [0.5, 0.5, 0.5]]
2429
test_coord = [0.1, 0.1, 0.1]

0 commit comments

Comments
 (0)