Skip to content

Commit

Permalink
Fix wrong syntax in a unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
hugoledoux committed Oct 23, 2024
1 parent 73edabc commit 3acf9da
Showing 1 changed file with 16 additions and 13 deletions.
29 changes: 16 additions & 13 deletions tests/test_remove.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,32 +45,35 @@ def test_remove_invalid():
dt.remove(11)
with pytest.raises(IndexError):
dt.remove(11)



def test_cocircular():
dt = startinpy.DT()
dt.insert_one_pt([0.0, 0.0, 12.5]);
dt.insert_one_pt([1.0, 0.0, 7.65]);
dt.insert_one_pt([1.0, 1.0, 33.0]);
dt.insert_one_pt([0.0, 1.0, 21.0]);
dt.insert_one_pt([0.0, 0.0, 12.5])
dt.insert_one_pt([1.0, 0.0, 7.65])
dt.insert_one_pt([1.0, 1.0, 33.0])
dt.insert_one_pt([0.0, 1.0, 21.0])
y = 0.5 + math.sqrt(0.5 * 0.5 + 0.5 * 0.5)
dt.insert_one_pt([0.5, y, 21.0]);
dt.insert_one_pt([0.5, 0.5, 33.0]);
dt.insert_one_pt([0.5, y, 21.0])
dt.insert_one_pt([0.5, 0.5, 33.0])
dt.remove(6)
assert dt.number_of_vertices() == 5
assert dt.number_of_triangles() == 3


def test_convexhull():
dt = startinpy.DT()
dt.insert_one_pt([0.0, 0.0, 12.5]);
dt.insert_one_pt([1.0, 0.0, 7.65]);
dt.insert_one_pt([1.0, 1.0, 33.0]);
dt.insert_one_pt([0.0, 1.0, 21.0]);
dt.insert_one_pt([0.0, 0.0, 12.5])
dt.insert_one_pt([1.0, 0.0, 7.65])
dt.insert_one_pt([1.0, 1.0, 33.0])
dt.insert_one_pt([0.0, 1.0, 21.0])
dt.remove(3)
assert dt.number_of_vertices() == 3
assert dt.number_of_triangles() == 1
assert dt.number_of_triangles() == 1
dt.remove(2)
assert dt.number_of_vertices() == 2
assert dt.number_of_triangles() == 0
assert dt.number_of_triangles() == 0


def test_garbagecollection():
total = 100
Expand Down

0 comments on commit 3acf9da

Please sign in to comment.