Esempio n. 1
0
    def test_ensure_clear_observer_sets_observer_to_none(self, _):
        presenter = PeaksViewerCollectionPresenter(MagicMock())
        presenter._ads_observer = MagicMock()

        presenter.clear_observer()

        self.assertEqual(presenter._ads_observer, None)
Esempio n. 2
0
    def test_ensure_that_the_ads_observer_calls_remove_handle(self, _):
        presenter = PeaksViewerCollectionPresenter(MagicMock())
        presenter.delete_handle = MagicMock()
        self.assertTrue(isinstance(presenter._ads_observer, SliceViewerADSObserver))
        presenter._ads_observer = SliceViewerADSObserver(presenter.replace_handle, presenter.rename_handle,
                                                         presenter.clear_handle, presenter.delete_handle)

        CreateSampleWorkspace(OutputWorkspace="ws")
        ADS.remove("ws")

        presenter.delete_handle.assert_called_once_with("ws")