Skip to content

Commit a837000

Browse files
committed
Update test
1 parent f87fac4 commit a837000

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

tests/client/tui/test_main.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@
1717

1818

1919
@pytest.mark.parametrize("test_params", test_get_visit_list_params_matrix)
20-
@mock.patch("murfey.client.tui.main.requests")
20+
@mock.patch("murfey.client.tui.main.capture_get")
2121
def test_get_visit_list(
22-
mock_request,
22+
mock_request_get,
2323
test_params: tuple[str],
2424
mock_client_configuration,
2525
):
@@ -49,17 +49,19 @@ def test_get_visit_list(
4949
mock_response = Mock()
5050
mock_response.status_code = 200
5151
mock_response.json.return_value = example_visits
52-
mock_request.get.return_value = mock_response
52+
mock_request_get.return_value = mock_response
5353

5454
# read_config() has to be patched using fixture, so has to be done in function
5555
with mock.patch("murfey.util.client.read_config", mock_client_configuration):
5656
visits = _get_visit_list(urlparse(server_url), instrument_name)
5757

5858
# Check that request was sent with the correct URL
59-
expected_url = (
60-
f"{server_url}/session_control/instruments/{instrument_name}/visits_raw"
59+
mock_request_get.assert_called_once_with(
60+
base_url=server_url,
61+
router_name="session_control.router",
62+
function_name="get_current_visits",
63+
instrument_name=instrument_name,
6164
)
62-
mock_request.get.assert_called_once_with(expected_url)
6365

6466
# Check that expected outputs are correct (order-sensitive)
6567
for v, visit in enumerate(visits):

0 commit comments

Comments
 (0)