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:
parent
20d176e513
commit
06d17bc5fb
@ -7,9 +7,8 @@ coverage>=3.6
|
|||||||
ddt>=0.7.0
|
ddt>=0.7.0
|
||||||
django-nose>=1.2
|
django-nose>=1.2
|
||||||
mock>=1.2
|
mock>=1.2
|
||||||
mox3>=0.7.0
|
|
||||||
python-subunit>=0.0.18
|
python-subunit>=0.0.18
|
||||||
selenium
|
selenium>=2.50.1 # Apache-2.0
|
||||||
sphinx>=1.6.2 # BSD
|
sphinx>=1.6.2 # BSD
|
||||||
openstackdocstheme>=1.17.0 # Apache-2.0
|
openstackdocstheme>=1.17.0 # Apache-2.0
|
||||||
testrepository>=0.0.18
|
testrepository>=0.0.18
|
||||||
|
@ -11,11 +11,8 @@
|
|||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
from troveclient import client as trove_client
|
|
||||||
|
|
||||||
from openstack_dashboard.test import helpers
|
from openstack_dashboard.test import helpers
|
||||||
|
|
||||||
from trove_dashboard import api
|
|
||||||
from trove_dashboard.test.test_data import utils
|
from trove_dashboard.test.test_data import utils
|
||||||
|
|
||||||
|
|
||||||
@ -42,30 +39,8 @@ class TroveTestsMixin(object):
|
|||||||
|
|
||||||
|
|
||||||
class TestCase(TroveTestsMixin, helpers.TestCase):
|
class TestCase(TroveTestsMixin, helpers.TestCase):
|
||||||
# We should declare mox dependency before we finish mock migration
|
pass
|
||||||
# for all test cases.
|
|
||||||
use_mox = True
|
|
||||||
|
|
||||||
|
|
||||||
class BaseAdminViewTests(TroveTestsMixin, helpers.TestCase):
|
class BaseAdminViewTests(TroveTestsMixin, helpers.TestCase):
|
||||||
pass
|
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
|
|
||||||
|
Loading…
Reference in New Issue
Block a user