Skip to content

Commit

Permalink
ADD: additional tests for Assortment Optimizers
Browse files Browse the repository at this point in the history
  • Loading branch information
VincentAuriau committed Dec 28, 2024
1 parent b19e639 commit 9606de1
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tests/unit_tests/tools/test_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ def test_wrong_solver():
assortment_size=2,
)


def test_raised_errors():
"""Test diverse parametrization that should raise errors."""
with pytest.raises(ValueError):
Expand All @@ -98,7 +99,7 @@ def test_raised_errors():
itemwise_values=np.array([0.5, 0.5, 0.5]),
assortment_size=2,
)

with pytest.raises(ValueError):
LatentClassAssortmentOptimizer(
solver="ortools",
Expand All @@ -118,7 +119,7 @@ def test_raised_errors():
itemwise_values=np.array([[0.5, 1.2, 2.4], [0.5, 1.2, 2.4], [0.5, 1.2, 2.4]]),
assortment_size=2,
)

with pytest.raises(ValueError):
LatentClassPricingOptimizer(
solver="ortools",
Expand Down

0 comments on commit 9606de1

Please sign in to comment.