|
10 | 10 | make_rsyncer_destination, |
11 | 11 | suggest_path, |
12 | 12 | ) |
| 13 | +from murfey.util.config import MachineConfig |
13 | 14 |
|
14 | 15 |
|
15 | 16 | @pytest.mark.parametrize( |
@@ -58,13 +59,16 @@ def test_suggest_path( |
58 | 59 | mock_db.exec.return_value.one.return_value = mock_session |
59 | 60 |
|
60 | 61 | # Mock 'get_machine_config' |
61 | | - mock_machine_config = MagicMock() |
62 | | - mock_machine_config.rsync_basepath = rsync_basepath |
63 | | - mock_machine_config.mkdir_chmod = 0o775 |
| 62 | + machine_config = MachineConfig( |
| 63 | + **{ |
| 64 | + "rsync_basepath": str(rsync_basepath), |
| 65 | + "mkdir_chmod": "0o775", |
| 66 | + } |
| 67 | + ) |
64 | 68 | mocker.patch( |
65 | 69 | "murfey.server.api.file_io_instrument.get_machine_config", |
66 | 70 | return_value={ |
67 | | - instrument_name: mock_machine_config, |
| 71 | + instrument_name: machine_config, |
68 | 72 | }, |
69 | 73 | ) |
70 | 74 |
|
@@ -133,13 +137,16 @@ def test_make_rsyncer_destination( |
133 | 137 | mock_db.exec.return_value.one.return_value = mock_session |
134 | 138 |
|
135 | 139 | # Mock 'get_machine_config' |
136 | | - mock_machine_config = MagicMock() |
137 | | - mock_machine_config.rsync_basepath = rsync_basepath |
138 | | - mock_machine_config.mkdir_chmod = 0o775 |
| 140 | + machine_config = MachineConfig( |
| 141 | + **{ |
| 142 | + "rsync_basepath": str(rsync_basepath), |
| 143 | + "mkdir_chmod": "0o775", |
| 144 | + } |
| 145 | + ) |
139 | 146 | mocker.patch( |
140 | 147 | "murfey.server.api.file_io_instrument.get_machine_config", |
141 | 148 | return_value={ |
142 | | - instrument_name: mock_machine_config, |
| 149 | + instrument_name: machine_config, |
143 | 150 | }, |
144 | 151 | ) |
145 | 152 |
|
|
0 commit comments