Skip to content

Commit

Permalink
Change test sequence
Browse files Browse the repository at this point in the history
  • Loading branch information
SilkeSchomann committed Dec 5, 2024
1 parent f1ffa67 commit 04c8802
Showing 1 changed file with 8 additions and 12 deletions.
20 changes: 8 additions & 12 deletions tests/workspacemanager_presenter_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -436,35 +436,31 @@ def test_compose_error(self):
self.presenter.notify(Command.ComposeWorkspace)
self.view._display_error.assert_called()

def test_ensure_that_the_ads_observer_calls_delete_handle(self):
def test_ensure_that_the_ads_observer_calls_clear_handle(self):
presenter = WorkspaceManagerPresenter(self.view)
presenter.delete_handle = mock.Mock()
presenter.clear_handle = mock.Mock()
self.assertTrue(isinstance(presenter._ads_observer, MSliceADSObserver))
presenter._ads_observer = MSliceADSObserver(
presenter.delete_handle, presenter.clear_handle, presenter.rename_handle
)

# Ensure ADS is empty before test
AnalysisDataService.clear(True)
CreateSampleWorkspace(OutputWorkspace="ws", StoreInADS=True)
AnalysisDataService.remove("ws")
AnalysisDataService.clear(True)

presenter.delete_handle.assert_called_once_with("ws")
presenter.clear_handle.assert_called_once()

def test_ensure_that_the_ads_observer_calls_clear_handle(self):
def test_ensure_that_the_ads_observer_calls_delete_handle(self):
presenter = WorkspaceManagerPresenter(self.view)
presenter.clear_handle = mock.Mock()
presenter.delete_handle = mock.Mock()
self.assertTrue(isinstance(presenter._ads_observer, MSliceADSObserver))
presenter._ads_observer = MSliceADSObserver(
presenter.delete_handle, presenter.clear_handle, presenter.rename_handle
)

# Ensure ADS is empty before test
AnalysisDataService.clear(True)
CreateSampleWorkspace(OutputWorkspace="ws", StoreInADS=True)
AnalysisDataService.clear(True)
AnalysisDataService.remove("ws")

presenter.clear_handle.assert_called_once()
presenter.delete_handle.assert_called_once_with("ws")

def test_ensure_that_the_ads_observer_calls_rename_handle(self):
presenter = WorkspaceManagerPresenter(self.view)
Expand Down

0 comments on commit 04c8802

Please sign in to comment.