Skip to content

Commit 1de4a89

Browse files
committed
Try more comprehensive tomo metadata test
1 parent 3b02ae6 commit 1de4a89

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

tests/server/test_ispyb.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ def test_update_data_collection_group(mock_transport, ispyb_db_session: Session)
7878
table=DataCollectionGroup,
7979
insert_kwargs={
8080
"dataCollectionGroupId": 1,
81+
"sessionId": 0,
8182
"experimentTypeId": 1,
8283
},
8384
)

tests/workflows/tomo/test_tomo_metadata.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -135,12 +135,16 @@ def test_register_search_map_update_with_all_parameters(
135135
assert sm_final_parameters.y_location is not None
136136

137137
# Check this would have updated ispyb
138-
mock_transport.do_update_search_map.assert_any_call(1, new_parameters)
139-
new_parameters.x_location = sm_final_parameters.x_location
140-
new_parameters.y_location = sm_final_parameters.y_location
141-
new_parameters.height_on_atlas = int(40 * 7.8)
142-
new_parameters.width_on_atlas = int(20 * 7.8)
143-
mock_transport.do_update_search_map.assert_any_call(1, new_parameters)
138+
update_args = mock_transport.do_update_search_map.call_args_list
139+
assert len(update_args) == 2
140+
assert update_args[0][0] == 1
141+
assert update_args[1][0] == 1
142+
assert update_args[0][1].x_location == new_parameters.x_location
143+
assert update_args[0][1].y_location == new_parameters.y_location
144+
assert update_args[1][1].x_location == sm_final_parameters.x_location
145+
assert update_args[1][1].x_location == sm_final_parameters.y_location
146+
assert update_args[1][1].height_on_atlas == int(40 * 7.8)
147+
assert update_args[1][1].width_on_atlas == int(20 * 7.8)
144148

145149

146150
@mock.patch("murfey.workflows.tomo.tomo_metadata._transport_object")

0 commit comments

Comments
 (0)