|
17 | 17 |
|
18 | 18 |
|
19 | 19 | @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") |
21 | 21 | def test_get_visit_list( |
22 | | - mock_request, |
| 22 | + mock_request_get, |
23 | 23 | test_params: tuple[str], |
24 | 24 | mock_client_configuration, |
25 | 25 | ): |
@@ -49,17 +49,19 @@ def test_get_visit_list( |
49 | 49 | mock_response = Mock() |
50 | 50 | mock_response.status_code = 200 |
51 | 51 | mock_response.json.return_value = example_visits |
52 | | - mock_request.get.return_value = mock_response |
| 52 | + mock_request_get.return_value = mock_response |
53 | 53 |
|
54 | 54 | # read_config() has to be patched using fixture, so has to be done in function |
55 | 55 | with mock.patch("murfey.util.client.read_config", mock_client_configuration): |
56 | 56 | visits = _get_visit_list(urlparse(server_url), instrument_name) |
57 | 57 |
|
58 | 58 | # 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, |
61 | 64 | ) |
62 | | - mock_request.get.assert_called_once_with(expected_url) |
63 | 65 |
|
64 | 66 | # Check that expected outputs are correct (order-sensitive) |
65 | 67 | for v, visit in enumerate(visits): |
|
0 commit comments