update from last round
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import pytest
|
||||
from rota.shifts import NoWorkers, RotaBuilder, SingleShift, days
|
||||
from rota.shifts import NoWorkers, RotaBuilder, SingleShift, WarningTermination, days
|
||||
|
||||
import datetime
|
||||
from rota.workers import Worker
|
||||
@@ -64,7 +64,7 @@ class TestWorkers:
|
||||
),
|
||||
)
|
||||
|
||||
with pytest.raises(ValueError):
|
||||
with pytest.raises(WarningTermination):
|
||||
Rota.build_and_solve(solve=False)
|
||||
|
||||
def test_worker_ftes(self):
|
||||
@@ -143,6 +143,10 @@ class TestWorkers:
|
||||
),
|
||||
)
|
||||
|
||||
with pytest.raises(WarningTermination):
|
||||
Rota.build_and_solve()
|
||||
|
||||
Rota.terminate_on_warning.remove("Worker/no valid shifts")
|
||||
Rota.build_and_solve()
|
||||
|
||||
# All workers should have an adjusted fte of 50 %
|
||||
@@ -298,6 +302,7 @@ class TestWorkers:
|
||||
),
|
||||
)
|
||||
|
||||
Rota.terminate_on_warning.remove("Worker/no valid shifts")
|
||||
Rota.build_and_solve()
|
||||
|
||||
# All workers should have an adjusted fte of 50 %
|
||||
@@ -353,7 +358,7 @@ class TestWorkers:
|
||||
Rota.build_and_solve()
|
||||
|
||||
# With two paired workers we shouldn't be able to solve
|
||||
assert Rota.results.solver.status == "warning"
|
||||
assert Rota.results.solver.status in ("warning", "error")
|
||||
|
||||
worker3 = Worker(name="worker3", site="group1", grade=1, fte=100)
|
||||
Rota.add_worker(worker3)
|
||||
@@ -374,7 +379,7 @@ class TestWorkers:
|
||||
|
||||
Rota.build_and_solve()
|
||||
|
||||
assert Rota.results.solver.status == "warning"
|
||||
assert Rota.results.solver.status in ("warning", "error")
|
||||
|
||||
worker3.pair = 0
|
||||
|
||||
|
||||
Reference in New Issue
Block a user