summaryrefslogtreecommitdiff
path: root/src/python/test
diff options
context:
space:
mode:
authorVincent Rouvreau <10407034+VincentRouvreau@users.noreply.github.com>2022-02-14 11:07:30 +0100
committerGitHub <noreply@github.com>2022-02-14 11:07:30 +0100
commit2a2aae065bf34cfcf8bba52695ce3ae3ca6d4048 (patch)
tree7d3b94840c2bc099a837c5852d5301c1c2a28ffc /src/python/test
parentcead99a89dcb017e2e4da803de82823b52968c1c (diff)
parent854cb0726336013cf9faede10ba61b0c6da938d3 (diff)
Merge pull request #463 from VincentRouvreau/python_stree_equality_operator
Add equality operator for python Simplex tree
Diffstat (limited to 'src/python/test')
-rwxr-xr-xsrc/python/test/test_simplex_tree.py13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/python/test/test_simplex_tree.py b/src/python/test/test_simplex_tree.py
index 31c46213..9766ecfe 100755
--- a/src/python/test/test_simplex_tree.py
+++ b/src/python/test/test_simplex_tree.py
@@ -447,4 +447,15 @@ def test_persistence_intervals_in_dimension():
assert np.array_equal(H2, np.array([[ 0., float("inf")]]))
# Test empty case
assert st.persistence_intervals_in_dimension(3).shape == (0, 2)
- \ No newline at end of file
+
+def test_equality_operator():
+ st1 = SimplexTree()
+ st2 = SimplexTree()
+
+ assert st1 == st2
+
+ st1.insert([1,2,3], 4.)
+ assert st1 != st2
+
+ st2.insert([1,2,3], 4.)
+ assert st1 == st2