Skip to content

Commit

Permalink
Use magicmock
Browse files Browse the repository at this point in the history
  • Loading branch information
SilkeSchomann committed Dec 5, 2024
1 parent 04c8802 commit fec408f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tests/workspacemanager_presenter_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import unittest

import mock
from mock import call, patch
from mock import call, patch, MagicMock
import numpy as np

from mantid.api import AnalysisDataService
Expand Down Expand Up @@ -438,7 +438,7 @@ def test_compose_error(self):

def test_ensure_that_the_ads_observer_calls_clear_handle(self):
presenter = WorkspaceManagerPresenter(self.view)
presenter.clear_handle = mock.Mock()
presenter.clear_handle = MagicMock()
self.assertTrue(isinstance(presenter._ads_observer, MSliceADSObserver))
presenter._ads_observer = MSliceADSObserver(
presenter.delete_handle, presenter.clear_handle, presenter.rename_handle
Expand All @@ -451,7 +451,7 @@ 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.delete_handle = mock.Mock()
presenter.delete_handle = MagicMock()
self.assertTrue(isinstance(presenter._ads_observer, MSliceADSObserver))
presenter._ads_observer = MSliceADSObserver(
presenter.delete_handle, presenter.clear_handle, presenter.rename_handle
Expand All @@ -464,7 +464,7 @@ def test_ensure_that_the_ads_observer_calls_delete_handle(self):

def test_ensure_that_the_ads_observer_calls_rename_handle(self):
presenter = WorkspaceManagerPresenter(self.view)
presenter.rename_handle = mock.Mock()
presenter.rename_handle = MagicMock()
self.assertTrue(isinstance(presenter._ads_observer, MSliceADSObserver))
presenter._ads_observer = MSliceADSObserver(
presenter.delete_handle, presenter.clear_handle, presenter.rename_handle
Expand Down

0 comments on commit fec408f

Please sign in to comment.