Skip to content

Commit df1f732

Browse files
committed
Pass messages to test in reverse order as well
1 parent 72b2b1f commit df1f732

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

tests/workflows/clem/test_register_preprocessing_results.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,13 +163,24 @@ def test_run(
163163
)
164164

165165

166+
test_matrix = (
167+
# Reverse order of list
168+
(False,),
169+
(True,),
170+
)
171+
172+
173+
@pytest.mark.parametrize("test_params", test_matrix)
166174
def test_run_with_db(
167175
mocker: MockerFixture,
168176
rsync_basepath: Path,
169177
mock_ispyb_credentials,
170178
murfey_db_session: SQLModelSession,
171179
ispyb_db_session: SQLAlchemySession,
180+
test_params: tuple[bool],
172181
):
182+
(shuffle_message,) = test_params
183+
173184
# Create a session to insert for this test
174185
murfey_session: MurfeyDB.Session = get_or_create_db_entry(
175186
murfey_db_session,
@@ -234,12 +245,16 @@ def test_run_with_db(
234245
rsync_basepath=rsync_basepath,
235246
session_id=murfey_session.id,
236247
)
248+
if shuffle_message:
249+
preprocessing_messages.reverse()
237250
for message in preprocessing_messages:
238251
result = run(
239252
message=message,
240253
murfey_db=murfey_db_session,
241254
)
242255
assert result == {"success": True}
256+
# Each message should call the align-and-merge workflow thrice
257+
# if gray and colour channels are both present
243258
assert mock_align_and_merge_call.call_count == len(preprocessing_messages) * len(
244259
colors
245260
)

0 commit comments

Comments
 (0)