Skip to content

Commit

Permalink
Extra tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Simon-Rey committed May 30, 2024
1 parent 7e0698e commit 2950a37
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
1 change: 1 addition & 0 deletions tests/test_combinatorics.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ def test_all_the_rest(self):
with self.assertRaises(ValueError):
gs_structure(((0, 1, 2), (2, 0, 1), (1, 2, 0)), verbose=True)
node = GSNode({0, 1, 2})
node.children = [GSNode({3}), GSNode({4, 5})]
node.__repr__()
node.print_tree()
node.tree_representation()
4 changes: 4 additions & 0 deletions tests/test_samplers/approval/test_approval_resampling.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,10 @@ def test_approval_disjoint_resampling(self):
)

def test_approval_moving_resampling(self):
with self.assertRaises(ValueError):
moving_resampling(4, 5, rel_size_central_vote=-0.5, phi=0.3, num_legs=2)
with self.assertRaises(ValueError):
moving_resampling(4, 5, rel_size_central_vote=1.5, phi=0.3, num_legs=3)
with self.assertRaises(ValueError):
moving_resampling(4, 5, rel_size_central_vote=0.5, phi=-0.4, num_legs=2)
with self.assertRaises(ValueError):
Expand Down
10 changes: 10 additions & 0 deletions tests/test_samplers/ordinal/test_ordinal_euclidean.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ def test_weak_orders(self):
tie_radius=-0.4,
)

def test_bad_positions(self):
with self.assertRaises(ValueError):
euclidean(
10,
Expand All @@ -128,6 +129,15 @@ def test_weak_orders(self):
lambda num_points, num_dimensions, seed=None: 1,
)

with self.assertRaises(ValueError):
euclidean(
1,
2,
2,
EuclideanSpace.UNIFORM_CUBE,
[[0.4, 0.2, 0.1], [0.1, 0.3, 0.8]],
)

def test_euclidean_space_to_sampler(self):
with self.assertRaises(ValueError):
euclidean_space_to_sampler("Bonjour", 2)

0 comments on commit 2950a37

Please sign in to comment.