update from last round
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import datetime
|
||||
import pytest
|
||||
from pytest import approx
|
||||
from rota.shifts import InvalidShift, NoWorkers, RotaBuilder, SingleShift, days
|
||||
|
||||
from rota.workers import Worker
|
||||
@@ -179,7 +180,7 @@ class TestWorkerRequests:
|
||||
|
||||
worker = Rota.get_worker_by_name(worker_name)
|
||||
|
||||
assert worker_shifts["a"] in (46, 47)
|
||||
assert worker_shifts["a"] in (approx(46), approx(47))
|
||||
|
||||
# shift_string = Rota.get_worker_shift_list_string(worker)
|
||||
|
||||
@@ -216,7 +217,7 @@ class TestWorkerRequests:
|
||||
Rota.build_and_solve(options={"ratio": 0.000})
|
||||
Rota.export_rota_to_html("unavailable_to_work2")
|
||||
|
||||
assert Rota.results.solver.status == "warning"
|
||||
assert Rota.results.solver.status in ("warning", "error")
|
||||
assert Rota.results.solver.termination_condition == "infeasible"
|
||||
|
||||
def test_unavailable_to_work3(self):
|
||||
@@ -304,7 +305,7 @@ class TestWorkerRequests:
|
||||
Rota.build_and_solve(options={"ratio": 0.000})
|
||||
Rota.export_rota_to_html("unavailable_to_work4")
|
||||
|
||||
assert Rota.results.solver.status == "warning"
|
||||
assert Rota.results.solver.status in ("warning", "error")
|
||||
assert Rota.results.solver.termination_condition == "infeasible"
|
||||
|
||||
def test_work_requests(self):
|
||||
@@ -523,7 +524,7 @@ class TestWorkerRequests:
|
||||
worker = Rota.get_worker_by_name(worker_name)
|
||||
|
||||
assert worker_shifts["a"] in (26, 27)
|
||||
assert worker_shifts["b"] == 10
|
||||
assert worker_shifts["b"] == approx(10)
|
||||
|
||||
shift_string = Rota.get_worker_shift_list_string(worker)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user