11from pathlib import Path
2- from typing import Literal
3- from unittest .mock import MagicMock , patch
2+ from unittest .mock import MagicMock
43
54import pytest
5+ from pytest_mock import MockerFixture
66
77from murfey .server .ispyb import TransportManager
88from murfey .util .config import MachineConfig
2323]
2424feedback_queue = "murfey_feedback"
2525
26- # Align and merge settings
27- crop_to_n_frames = 20
28- align_self : Literal ["enabled" , "" ] = "enabled"
29- flatten : Literal ["mean" , "min" , "max" , "" ] = "max"
30- align_across : Literal ["enabled" , "" ] = "enabled"
31-
3226
3327@pytest .fixture
3428def processed_dir (tmp_path : Path ):
@@ -62,9 +56,8 @@ def metadata(processed_dir: Path):
6256 return metadata
6357
6458
65- @patch ("murfey.workflows.clem.align_and_merge.get_machine_config" )
6659def test_run (
67- mock_get_machine_config ,
60+ mocker : MockerFixture ,
6861 image_stacks : list [Path ],
6962 metadata : Path ,
7063 processed_dir : Path ,
@@ -81,6 +74,9 @@ def test_run(
8174 # Construct a mock MachineConfig object for use within the function
8275 mock_machine_config = MagicMock (spec = MachineConfig )
8376 mock_machine_config .processed_directory_name = processed_folder
77+ mock_get_machine_config = mocker .patch (
78+ "murfey.workflows.clem.align_and_merge.get_machine_config"
79+ )
8480 mock_get_machine_config .return_value = {
8581 instrument_name : mock_machine_config ,
8682 }
@@ -92,10 +88,6 @@ def test_run(
9288 series_name = series_name_long ,
9389 images = image_stacks ,
9490 metadata = metadata ,
95- crop_to_n_frames = crop_to_n_frames ,
96- align_self = align_self ,
97- flatten = flatten ,
98- align_across = align_across ,
9991 messenger = mock_transport ,
10092 )
10193
0 commit comments