From f9e4b044a835272a4e4b9ed50c3d95069464b7f4 Mon Sep 17 00:00:00 2001 From: Pabloo22 Date: Wed, 9 Oct 2024 13:42:35 +0200 Subject: [PATCH] [Tests] Add test for invalid job sequences in `Schedule.from_job_sequences` --- tests/test_schedule.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/test_schedule.py b/tests/test_schedule.py index 300b6c5..0ae73c7 100644 --- a/tests/test_schedule.py +++ b/tests/test_schedule.py @@ -106,6 +106,18 @@ def test_from_job_sequences(example_job_shop_instance: JobShopInstance): assert schedule.makespan() == 11 +def test_from_job_sequences_invalid(example_job_shop_instance: JobShopInstance): + job_sequences = [ + [0, 1, 2], + [2, 0, 1], + [1, 0, 2], + ] + with pytest.raises(ValidationError): + Schedule.from_job_sequences( + example_job_shop_instance, job_sequences + ) + + def test_to_dict(example_job_shop_instance: JobShopInstance): job_sequences = [ [0, 2, 1],