fix small test error
This commit is contained in:
@@ -919,7 +919,6 @@ def test_worker_assign_as_block_preference2():
|
|||||||
"""Test that a worker's assign_as_block preference is respected over the global setting."""
|
"""Test that a worker's assign_as_block preference is respected over the global setting."""
|
||||||
Rota = generate_basic_rota(workers=4, weeks_to_rota=8)
|
Rota = generate_basic_rota(workers=4, weeks_to_rota=8)
|
||||||
|
|
||||||
# Worker 1 prefers to have shift 'a' assigned as a block, worker 2 does not
|
|
||||||
workers = Rota.get_workers()
|
workers = Rota.get_workers()
|
||||||
worker1 = workers[0]
|
worker1 = workers[0]
|
||||||
worker2 = workers[1]
|
worker2 = workers[1]
|
||||||
@@ -952,10 +951,12 @@ def test_worker_assign_as_block_preference2():
|
|||||||
a_shift.assign_as_block = True # Set the shift 'a' to be assigned as a block globally
|
a_shift.assign_as_block = True # Set the shift 'a' to be assigned as a block globally
|
||||||
Rota.build_and_solve(options={"ratio": 0.0})
|
Rota.build_and_solve(options={"ratio": 0.0})
|
||||||
|
|
||||||
|
Rota.export_rota_to_html("test_worker_assign_as_block_preference", folder="tests")
|
||||||
|
|
||||||
for worker in Rota.get_workers():
|
for worker in Rota.get_workers():
|
||||||
shift_list = Rota.get_worker_shift_list_string(worker)
|
shift_list = Rota.get_worker_shift_list_string(worker)
|
||||||
# All workers should have 'a' shifts grouped together (block)
|
# All workers should have 'a' shifts grouped together (block)
|
||||||
assert shift_list.count("aaaa") == 3, f"Worker {worker.name} should have all 'a' shifts grouped together (block)"
|
assert shift_list.count("aaaa") == 2, f"Worker {worker.name} should have all 'a' shifts grouped together (block)"
|
||||||
|
|
||||||
def test_worker_assign_as_block_preference_multiple_shifts():
|
def test_worker_assign_as_block_preference_multiple_shifts():
|
||||||
"""Test that a worker's assign_as_block preference is respected over the global setting."""
|
"""Test that a worker's assign_as_block preference is respected over the global setting."""
|
||||||
|
|||||||
Reference in New Issue
Block a user