From c0ab99a070d1b10bde523875cb5e11f3f9c4fdb0 Mon Sep 17 00:00:00 2001 From: Charles Short Date: Fri, 23 Mar 2018 09:32:56 -0400 Subject: [PATCH] Drop mox3 from test-requirements.txt create_stubs in test.helpers is also dropped in this commit because this creates a stub using mox This is part of mox-removal community goal in Rocky. Story: 2001546 Task: 8719 Change-Id: Ic97d45f3b265cf61ad483c33b4d29b975dd93a5f Signed-off-by: Charles Short --- monitoring/alarmdefs/tests.py | 1 - monitoring/alarms/tests.py | 1 + monitoring/notifications/tests.py | 1 + monitoring/overview/tests.py | 1 + monitoring/test/client_tests.py | 1 - monitoring/test/helpers.py | 7 +------ test-requirements.txt | 1 - 7 files changed, 4 insertions(+), 9 deletions(-) diff --git a/monitoring/alarmdefs/tests.py b/monitoring/alarmdefs/tests.py index ca958b0b..9555e93d 100644 --- a/monitoring/alarmdefs/tests.py +++ b/monitoring/alarmdefs/tests.py @@ -33,7 +33,6 @@ EDIT_URL = urlresolvers.reverse( class AlarmDefinitionsTest(helpers.TestCase): - def test_alarmdefs_get(self): with patch('monitoring.api.monitor', **{ 'spec_set': ['alarmdef_list'], diff --git a/monitoring/alarms/tests.py b/monitoring/alarms/tests.py index 77d2af17..7aa2541f 100644 --- a/monitoring/alarms/tests.py +++ b/monitoring/alarms/tests.py @@ -26,6 +26,7 @@ ALARMS_URL = urlresolvers.reverse( class AlarmsTest(helpers.TestCase): + def test_alarms_get_by_dimension(self): with patch('monitoring.api.monitor', **{ 'spec_set': ['alarm_list_by_dimension'], diff --git a/monitoring/notifications/tests.py b/monitoring/notifications/tests.py index a93ae2b9..7dbb8bc1 100644 --- a/monitoring/notifications/tests.py +++ b/monitoring/notifications/tests.py @@ -26,6 +26,7 @@ EDIT_URL = urlresolvers.reverse( class AlarmsTest(helpers.TestCase): + def test_index(self): with patch('monitoring.api.monitor', **{ 'spec_set': ['notification_list'], diff --git a/monitoring/overview/tests.py b/monitoring/overview/tests.py index 9ad6ba1e..f8375cc2 100644 --- a/monitoring/overview/tests.py +++ b/monitoring/overview/tests.py @@ -26,6 +26,7 @@ INDEX_URL = urlresolvers.reverse( class OverviewTest(helpers.TestCase): + def test_index_get(self): res = self.client.get(INDEX_URL) self.assertTemplateUsed( diff --git a/monitoring/test/client_tests.py b/monitoring/test/client_tests.py index e46ba880..6105373a 100644 --- a/monitoring/test/client_tests.py +++ b/monitoring/test/client_tests.py @@ -59,7 +59,6 @@ def _expected_session_args(verify): class ClientTests(helpers.TestCase): - @override_settings(OPENSTACK_SSL_NO_VERIFY=False) @override_settings(OPENSTACK_SSL_CACERT='/etc/ssl/certs/some.crt') def test_ssl_verify_with_cert(self): diff --git a/monitoring/test/helpers.py b/monitoring/test/helpers.py index afd89984..2e4faace 100644 --- a/monitoring/test/helpers.py +++ b/monitoring/test/helpers.py @@ -31,12 +31,6 @@ warnings.filterwarnings('ignore', 'With-statements now directly support ' r'^tuskar_ui[.].*[._]tests$') -def create_stubs(stubs_to_create=None): - if stubs_to_create is None: - stubs_to_create = {} - return helpers.create_stubs(stubs_to_create) - - class MonitoringTestsMixin(object): def _setup_test_data(self): super(MonitoringTestsMixin, self)._setup_test_data() @@ -49,6 +43,7 @@ class MonitoringTestsMixin(object): @unittest.skipIf(os.environ.get('SKIP_UNITTESTS', False), "The SKIP_UNITTESTS env variable is set.") class TestCase(MonitoringTestsMixin, helpers.TestCase): + use_mox = False pass diff --git a/test-requirements.txt b/test-requirements.txt index 277ed8d0..481b3c7b 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -8,7 +8,6 @@ coverage!=4.4,>=4.0 # Apache-2.0 django-nose>=1.4.4 # BSD mock>=2.0.0 # BSD funcsigs>=1.0.0;python_version=='2.7' or python_version=='2.6' # Apache-2.0 -mox3>=0.20.0 # Apache-2.0 nodeenv>=0.9.4 # BSD nose>=1.3.7 # LGPL nose-exclude>=0.3.0 # LGPL