From 06d17bc5fb683823326c81aeb2056a81af19d084 Mon Sep 17 00:00:00 2001 From: Zhao Chao Date: Fri, 29 Jun 2018 10:11:36 +0800 Subject: [PATCH] Finish removal of mox This is the final patch for mox removal, as all the other patches have been merged. The TroveAPITestCase class is also removed as it's not used at all. The"selenium" specification in test-requirements also updated according to global-requirements to fix requirements-check job. Change-Id: I84a5f4b784d4e473d3a4a12c0ace6786884bc9e3 Signed-off-by: Zhao Chao --- test-requirements.txt | 3 +-- trove_dashboard/test/helpers.py | 27 +-------------------------- 2 files changed, 2 insertions(+), 28 deletions(-) diff --git a/test-requirements.txt b/test-requirements.txt index 7c8c099..da25c1a 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -7,9 +7,8 @@ coverage>=3.6 ddt>=0.7.0 django-nose>=1.2 mock>=1.2 -mox3>=0.7.0 python-subunit>=0.0.18 -selenium +selenium>=2.50.1 # Apache-2.0 sphinx>=1.6.2 # BSD openstackdocstheme>=1.17.0 # Apache-2.0 testrepository>=0.0.18 diff --git a/trove_dashboard/test/helpers.py b/trove_dashboard/test/helpers.py index b25f4f0..18dcff5 100644 --- a/trove_dashboard/test/helpers.py +++ b/trove_dashboard/test/helpers.py @@ -11,11 +11,8 @@ # License for the specific language governing permissions and limitations # under the License. -from troveclient import client as trove_client - from openstack_dashboard.test import helpers -from trove_dashboard import api from trove_dashboard.test.test_data import utils @@ -42,30 +39,8 @@ class TroveTestsMixin(object): class TestCase(TroveTestsMixin, helpers.TestCase): - # We should declare mox dependency before we finish mock migration - # for all test cases. - use_mox = True + pass class BaseAdminViewTests(TroveTestsMixin, helpers.TestCase): pass - - -class TroveAPITestCase(helpers.APITestCase): - - def setUp(self): - super(TroveAPITestCase, self).setUp() - - self._original_troveclient = api.trove.client - api.trove.client = lambda request: self.stub_troveclient() - - def tearDown(self): - super(TroveAPITestCase, self).tearDown() - - api.trove.client = self._original_troveclient - - def stub_troveclient(self): - if not hasattr(self, "troveclient"): - self.mox.StubOutWithMock(trove_client, 'Client') - self.troveclient = self.mox.CreateMock(trove_client.Client) - return self.troveclient