|
1 | 1 | from __future__ import annotations |
2 | 2 |
|
3 | 3 | import pytest |
4 | | -from pytest_mock import MockerFixture |
5 | 4 |
|
6 | 5 | from murfey.client.analyser import Analyser |
7 | 6 | from murfey.client.contexts.clem import CLEMContext |
|
71 | 70 |
|
72 | 71 |
|
73 | 72 | @pytest.mark.parametrize("file_and_context", example_files) |
74 | | -def test_find_context(mocker: MockerFixture, file_and_context, tmp_path): |
| 73 | +def test_find_context(file_and_context, tmp_path): |
75 | 74 | # Unpack parametrised variables |
76 | 75 | file_name, context = file_and_context |
77 | 76 |
|
78 | | - # The CLEM Context requires a MurfeyInstanceEnvironment |
79 | | - if context is CLEMContext: |
80 | | - # Mock the MurfeyInstanceEnvironment |
81 | | - mock_environment = mocker.patch( |
82 | | - "murfey.client.analyser.MurfeyInstanceEnvironment" |
83 | | - ) |
84 | | - mock_environment.url.geturl.return_value = "https://murfey.server.test" |
85 | | - mock_environment.instrument_name = "Test" |
86 | | - mock_environment.demo = False |
87 | | - |
88 | | - # Mock the call to get the machine config |
89 | | - mocker.patch( |
90 | | - "murfey.client.analyser.get_machine_config_client", |
91 | | - return_value={"analyse_created_directories": ["images"]}, |
92 | | - ) |
93 | | - |
94 | 77 | # Pass the file to the Analyser; add environment as needed |
95 | | - analyser = Analyser( |
96 | | - basepath_local=tmp_path, |
97 | | - environment=(mock_environment if context is CLEMContext else None), |
98 | | - ) |
| 78 | + analyser = Analyser(basepath_local=tmp_path) |
99 | 79 |
|
100 | 80 | # Check that the results are as expected |
101 | 81 | assert analyser._find_context(tmp_path / file_name) |
|
0 commit comments