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 <zhaochao1984@gmail.com>
This commit is contained in:
Zhao Chao 2018-06-29 10:11:36 +08:00
parent 20d176e513
commit 06d17bc5fb
2 changed files with 2 additions and 28 deletions

View File

@ -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

View File

@ -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