def test_commandline_function_with_args(self, ): with patch('stitch_m.run.main_run', MagicMock()) as main_run: mosaic_arg = "mosaic_path" marker_arg = "marker_path" sys.argv = [ "StitchM", "--mosaic", mosaic_arg, "--markers", marker_arg ] commandline.main() main_run.assert_called_once_with(ANY, mosaic_arg, marker_arg)
def test_commandline_function_setup_windows_shortcut(self): local_config_file = Path( os.path.join( os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "stitch_m", "config.cfg")) with patch('stitch_m.file_handler.create_Windows_shortcut', MagicMock()) as mocked_shortcut_creator: sys.argv = ["StitchM", "setup", "-w"] commandline.main() mocked_shortcut_creator.assert_called_once()
def test_commandline_function_with_args(self, ): with patch('stitch_m.run.main_run', MagicMock()) as main_run: kwargs = {} kwargs['mosaic'] = "mosaic_path" kwargs['markers'] = "marker_path" kwargs['normalise'] = True sys.argv = [ "StitchM", "--mosaic", kwargs['mosaic'], "--markers", kwargs['markers'] ] commandline.main() main_run.assert_called_once_with(ANY, **kwargs)
def test_commandline_function_setup_subpaser(self, mocked_printhelp): sys.argv = ["StitchM", "setup"] commandline.main() mocked_printhelp.assert_called_once()
def test_commandline_function(self, mocked_printhelp): sys.argv = ["StitchM"] commandline.main() mocked_printhelp.assert_called_once()