From a4b82ae053f028e9c03a649735bd0453c54a5776 Mon Sep 17 00:00:00 2001 From: LiuNanke Date: Wed, 21 Sep 2016 14:06:31 +0800 Subject: [PATCH] Replace 'MagicMock' with 'Mock' This is part of an effort to replace all 'MagicMock' usage with 'Mock'. Change-Id: I8a2a0c9c5b21d1c6bf17ea1661bed6402d358471 Closes-Bug: #1475722 --- muranodashboard/tests/test_tabs.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/muranodashboard/tests/test_tabs.py b/muranodashboard/tests/test_tabs.py index 34b2771f2..7191f74bc 100644 --- a/muranodashboard/tests/test_tabs.py +++ b/muranodashboard/tests/test_tabs.py @@ -28,16 +28,16 @@ class TestLicenseTab(helpers.APITestCase): """Check that a license is returned.""" # Fake the services.get_app_forms() call. - m = mock.MagicMock() + m = mock.Mock() m.base_fields = { - 'license': mock.MagicMock( + 'license': mock.Mock( description='Lorem ipsum dolor sit ' 'amet, consectetur adipiscing elit.') } mock_services.get_app_forms.return_value = [('', m)] # Fake an application object, needed when instantiating tabs. - app = mock.MagicMock() + app = mock.Mock() app.id = 1 group = tabs.ApplicationTabs(self.request, application=app) @@ -54,12 +54,12 @@ class TestLicenseTab(helpers.APITestCase): """Check that no license is returned.""" # Fake the services.get_app_forms() call. - m = mock.MagicMock() + m = mock.Mock() m.base_fields = {} mock_services.get_app_forms.return_value = [('', m)] # Fake an application object, needed when instantiating tabs. - app = mock.MagicMock() + app = mock.Mock() app.id = 1 group = tabs.ApplicationTabs(self.request, application=app) @@ -79,9 +79,9 @@ class TestRequirementsTab(helpers.APITestCase): def test_requirements(self, mock_services): """Check that requirements are returned.""" - m = mock.MagicMock() + m = mock.Mock() m.base_fields = { - 'flavor': mock.MagicMock(requirements={ + 'flavor': mock.Mock(requirements={ 'min_disk': 10, 'min_vcpus': 2, 'min_memory_mb': 2048, @@ -92,7 +92,7 @@ class TestRequirementsTab(helpers.APITestCase): } mock_services.get_app_forms.return_value = [('', m)] - app = mock.MagicMock() + app = mock.Mock() app.id = 1 group = tabs.ApplicationTabs(self.request, application=app) @@ -121,11 +121,11 @@ class TestRequirementsTab(helpers.APITestCase): def test_no_requirements(self, mock_services): """Check that no requirements are returned.""" - m = mock.MagicMock() + m = mock.Mock() m.base_fields = {} mock_services.get_app_forms.return_value = [('', m)] - app = mock.MagicMock() + app = mock.Mock() app.id = 1 group = tabs.ApplicationTabs(self.request, application=app)