diff options
author | ROUVREAU Vincent <vincent.rouvreau@inria.fr> | 2020-08-12 13:06:03 +0200 |
---|---|---|
committer | ROUVREAU Vincent <vincent.rouvreau@inria.fr> | 2020-08-12 13:06:03 +0200 |
commit | 458bc2dcf5044e1d5fde5326b2be35e526abd457 (patch) | |
tree | 9e1cca62b825421feec3835f1b548e0ef8dafad8 /src/python/test/test_simplex_tree.py | |
parent | 8f9c065df7f4629555ef09292c14c293891f1bdc (diff) |
code review: boundaries uses only once find and return a pair of iterator. Exception is raised when not found. tested
Diffstat (limited to 'src/python/test/test_simplex_tree.py')
-rwxr-xr-x | src/python/test/test_simplex_tree.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/python/test/test_simplex_tree.py b/src/python/test/test_simplex_tree.py index 036e88df..828400fb 100755 --- a/src/python/test/test_simplex_tree.py +++ b/src/python/test/test_simplex_tree.py @@ -350,3 +350,12 @@ def test_boundaries_iterator(): assert list(st.get_boundaries([1, 2, 3])) == [([1, 2], 1.0), ([1, 3], 1.0), ([2, 3], 1.0)] assert list(st.get_boundaries([2, 3, 4])) == [([2, 3], 1.0), ([2, 4], 2.0), ([3, 4], 2.0)] assert list(st.get_boundaries([2])) == [] + + with pytest.raises(RuntimeError): + list(st.get_boundaries([])) + + with pytest.raises(RuntimeError): + list(st.get_boundaries([0, 4])) # (0, 4) does not exist + + with pytest.raises(RuntimeError): + list(st.get_boundaries([6])) # (6) does not exist |