Skip to content

Commit 3a76ca5

Browse files
committed
test transport init
1 parent b15a463 commit 3a76ca5

2 files changed

Lines changed: 12 additions & 5 deletions

File tree

tests/server/test_ispyb.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,12 @@ def test_get_all_ongoing_visits():
7171
pass
7272

7373

74+
@mock.patch("workflows.transport.pika_transport.PikaTransport")
75+
def test_transport_manager_init(mock_transport):
76+
TransportManager("PikaTransport")
77+
mock_transport().connect.assert_called_once()
78+
79+
7480
@mock.patch("workflows.transport.pika_transport.PikaTransport")
7581
def test_update_data_collection_group(mock_transport, ispyb_db_session: Session):
7682
# Manually get the BLSession ID for comparison

tests/workflows/tomo/test_tomo_metadata.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -137,14 +137,15 @@ def test_register_search_map_update_with_all_parameters(
137137
# Check this would have updated ispyb
138138
update_args = mock_transport.do_update_search_map.call_args_list
139139
assert len(update_args) == 2
140+
print(update_args)
140141
assert update_args[0][0][0] == 1
141-
assert update_args[0][1][0] == 1
142+
assert update_args[1][0][0] == 1
142143
assert update_args[0][0][1].x_stage_position == 0.3
143144
assert update_args[0][0][1].y_stage_position == 0.4
144-
assert update_args[0][1][1].x_location == sm_final_parameters.x_location
145-
assert update_args[0][1][1].x_location == sm_final_parameters.y_location
146-
assert update_args[0][1][1].height_on_atlas == int(40 * 7.8)
147-
assert update_args[0][1][1].width_on_atlas == int(20 * 7.8)
145+
assert update_args[1][0][1].x_location == sm_final_parameters.x_location
146+
assert update_args[1][0][1].x_location == sm_final_parameters.y_location
147+
assert update_args[1][0][1].height_on_atlas == int(40 * 7.8)
148+
assert update_args[1][0][1].width_on_atlas == int(20 * 7.8)
148149

149150

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

0 commit comments

Comments
 (0)