Skip to content

Commit 43a36be

Browse files
committed
Update tests
1 parent aeb6cd4 commit 43a36be

4 files changed

Lines changed: 14 additions & 7 deletions

File tree

tests/client/contexts/test_atlas.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def test_atlas_context_mrc(mock_capture_post, tmp_path):
2323
default_destinations={
2424
tmp_path / "cm12345-6": f"{tmp_path}/destination/cm12345-6"
2525
},
26-
instrument_name="",
26+
instrument_name="m01",
2727
visit="cm12345-6",
2828
murfey_session=1,
2929
)
@@ -42,6 +42,7 @@ def test_atlas_context_mrc(mock_capture_post, tmp_path):
4242
router_name="session_control.spa_router",
4343
function_name="make_atlas_jpg",
4444
token="token",
45+
instrument_name="m01",
4546
session_id=1,
4647
data={"path": f"{tmp_path}/destination/{atlas_mrc.relative_to(tmp_path)}"},
4748
)
@@ -56,7 +57,7 @@ def test_atlas_context_xml(mock_capture_post, tmp_path):
5657
default_destinations={
5758
tmp_path / "cm12345-6": f"{tmp_path}/destination/cm12345-6"
5859
},
59-
instrument_name="",
60+
instrument_name="m01",
6061
visit="cm12345-6",
6162
murfey_session=1,
6263
)
@@ -87,6 +88,7 @@ def test_atlas_context_xml(mock_capture_post, tmp_path):
8788
router_name="workflow.router",
8889
function_name="register_dc_group",
8990
token="token",
91+
instrument_name="m01",
9092
visit_name="cm12345-6",
9193
session_id=1,
9294
data=dcg_data,

tests/client/test_context.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ def test_ensure_dcg_exists_tomo(mock_capture_post, tmp_path):
1515
tmp_path
1616
/ "cm12345-6/metadata_folder": f"{tmp_path}/destination/cm12345-6/raw"
1717
},
18-
instrument_name="",
18+
instrument_name="m01",
1919
visit="cm12345-6",
2020
murfey_session=1,
2121
)
@@ -57,6 +57,7 @@ def test_ensure_dcg_exists_tomo(mock_capture_post, tmp_path):
5757
router_name="workflow.router",
5858
function_name="register_dc_group",
5959
token="token",
60+
instrument_name="m01",
6061
visit_name="cm12345-6",
6162
session_id=1,
6263
data=dcg_data,
@@ -73,7 +74,7 @@ def test_ensure_dcg_exists_spa(mock_capture_post, tmp_path):
7374
tmp_path
7475
/ "cm12345-6/metadata_folder": f"{tmp_path}/destination/cm12345-6/raw",
7576
},
76-
instrument_name="",
77+
instrument_name="m01",
7778
visit="cm12345-6",
7879
murfey_session=1,
7980
)
@@ -118,6 +119,7 @@ def test_ensure_dcg_exists_spa(mock_capture_post, tmp_path):
118119
router_name="workflow.router",
119120
function_name="register_dc_group",
120121
token="token",
122+
instrument_name="m01",
121123
visit_name="cm12345-6",
122124
session_id=1,
123125
data=dcg_data,
@@ -131,7 +133,7 @@ def test_ensure_dcg_exists_spa_missing_xml(mock_capture_post, tmp_path):
131133
client_id=0,
132134
sources=[tmp_path],
133135
default_destinations={tmp_path: str(tmp_path)},
134-
instrument_name="",
136+
instrument_name="m01",
135137
visit="cm12345-6",
136138
murfey_session=1,
137139
)
@@ -154,6 +156,7 @@ def test_ensure_dcg_exists_spa_missing_xml(mock_capture_post, tmp_path):
154156
router_name="workflow.router",
155157
function_name="register_dc_group",
156158
token="token",
159+
instrument_name="m01",
157160
visit_name="cm12345-6",
158161
session_id=1,
159162
data=dcg_data,

tests/client/test_destinations.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ def test_determine_default_destinations_suggested_path(mock_post, mock_get, sour
112112
router_name="file_io_instrument.router",
113113
function_name="suggest_path",
114114
token="token",
115+
instrument_name="m01",
115116
visit_name="cm12345-6",
116117
session_id=2,
117118
data={
@@ -162,6 +163,7 @@ def test_determine_default_destinations_short_path(mock_post, mock_get):
162163
router_name="file_io_instrument.router",
163164
function_name="suggest_path",
164165
token="token",
166+
instrument_name="m01",
165167
visit_name="cm12345-6",
166168
session_id=2,
167169
data={

tests/instrument_server/test_init.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
import murfey
1515
from murfey.client.update import UPDATE_SUCCESS
16-
from murfey.instrument_server import check_for_updates, start_instrument_server
16+
from murfey.instrument_server import check_for_updates, run
1717
from murfey.server.api.bootstrap import pypi as pypi_router, version as version_router
1818
from murfey.util.api import url_path_for
1919
from murfey.util.logging import HTTPSHandler
@@ -186,7 +186,7 @@ def test_start_instrument_server(
186186
sys.argv.extend(["--port", str(port)])
187187

188188
# Run the function
189-
start_instrument_server()
189+
run()
190190

191191
# Check that the server was called with the correct arguments
192192
args, kwargs = mock_server.call_args

0 commit comments

Comments
 (0)