def _make_presenter(self): self.view = self._make_mock_view() parent_view = self._make_mock_parent_view() presenter = AddRunsPagePresenter(mock.Mock(), self.view, parent_view) presenter._get_filename_manager = mock.Mock( return_value=MockedOutAddRunsFilenameManager()) return presenter
def _make_presenter(self, run_summation, run_selection, summation_settings): presenter = AddRunsPagePresenter(run_summation, run_selection, summation_settings, self.view, self.parent_view) presenter._get_filename_manager = mock.Mock( return_value=MockedOutAddRunsFilenameManager()) return presenter
def _make_presenter(self): presenter = AddRunsPagePresenter(mock.Mock(), self._capture_on_change_callback(self.run_selector_presenter), self._just_use_summation_settings_presenter(), self._view, self._parent_view) presenter._get_filename_manager = mock.Mock(return_value=MockedOutAddRunsFilenameManager()) return presenter
def _make_presenter(self): presenter = AddRunsPagePresenter( self._make_mock_run_summation(), self._capture_on_change_callback(self.run_selector_presenter), self._just_use_summation_settings_presenter(), self.view, self.parent_view) presenter._get_filename_manager = mock.Mock( return_value=MockedOutAddRunsFilenameManager()) return presenter
def _make_presenter(self, run_summation, run_selection, summation_settings): presenter = AddRunsPagePresenter(run_summation, run_selection, summation_settings, self.view, self.parent_view) presenter._get_filename_manager = mock.Mock(return_value=MockedOutAddRunsFilenameManager()) return presenter
def test_passes_correct_config_when_summation_requested(self, patched_run_selector): # Ensure we know the type that was returned by the constructor run_selector_mock = mock.Mock() patched_run_selector.return_value = run_selector_mock ConfigService["defaultsave.directory"] = "someDir/" run_summation = mock.Mock() presenter = AddRunsPagePresenter(run_summation, self.view, self.parent_view) presenter._get_filename_manager = mock.Mock(return_value=MockedOutAddRunsFilenameManager()) mocked_run_selector = mock.MagicMock() mocked_run_selector.has_any_runs.return_value = True run_number_mock = mock.Mock() run_number_mock.display_name.return_value = 3 mocked_run_selector.__iter__.return_value = [run_number_mock] run_selector_mock.run_selection.return_value = mocked_run_selector self.view.sum.emit() run_summation.assert_called_with(mock.ANY, mock.ANY, 'LOQ00003-add')
def _make_presenter(self): presenter = AddRunsPagePresenter(self._make_mock_run_summation(), self.view, self.parent_view) presenter._get_filename_manager = mock.Mock( return_value=MockedOutAddRunsFilenameManager()) return presenter