From: Yuriy Nesenenko Date: Fri, 11 Dec 2015 13:07:10 +0000 (+0200) Subject: Replace use of mox with mock in test_quotas X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=09f9937740808f44e7a4dd9705a0cd98c5024c51;p=openstack-build%2Fcinder-build.git Replace use of mox with mock in test_quotas This patch replaces the remaining cases of mox with mock in test_quotas.py and test_quotas_classes.py Change-Id: Ia417a3dcffc1ba4988853ff5768df9ee4fbcf92f Partial-Implements: blueprint mox-to-mock-conversion --- diff --git a/cinder/tests/unit/api/contrib/test_quotas.py b/cinder/tests/unit/api/contrib/test_quotas.py index 398f096d9..7f523e33b 100644 --- a/cinder/tests/unit/api/contrib/test_quotas.py +++ b/cinder/tests/unit/api/contrib/test_quotas.py @@ -87,11 +87,9 @@ class QuotaSetsControllerTest(test.TestCase): super(QuotaSetsControllerTest, self).setUp() self.controller = quotas.QuotaSetsController() - self.req = self.mox.CreateMockAnything() + self.req = mock.Mock() self.req.environ = {'cinder.context': context.get_admin_context()} self.req.environ['cinder.context'].is_admin = True - self.req.environ['cinder.context'].auth_token = uuid.uuid4().hex - self.req.environ['cinder.context'].project_id = 'foo' self._create_project_hierarchy() @@ -541,7 +539,7 @@ class QuotaSerializerTest(test.TestCase): def setUp(self): super(QuotaSerializerTest, self).setUp() - self.req = self.mox.CreateMockAnything() + self.req = mock.Mock() self.req.environ = {'cinder.context': context.get_admin_context()} def test_update_serializer(self): diff --git a/cinder/tests/unit/api/contrib/test_quotas_classes.py b/cinder/tests/unit/api/contrib/test_quotas_classes.py index 58a5ed18c..7f39882b1 100644 --- a/cinder/tests/unit/api/contrib/test_quotas_classes.py +++ b/cinder/tests/unit/api/contrib/test_quotas_classes.py @@ -86,7 +86,7 @@ class QuotaClassSetsControllerTest(test.TestCase): self.controller = quota_classes.QuotaClassSetsController() self.ctxt = context.get_admin_context() - self.req = self.mox.CreateMockAnything() + self.req = mock.Mock() self.req.environ = {'cinder.context': self.ctxt} self.req.environ['cinder.context'].is_admin = True @@ -158,7 +158,7 @@ class QuotaClassesSerializerTest(test.TestCase): def setUp(self): super(QuotaClassesSerializerTest, self).setUp() - self.req = self.mox.CreateMockAnything() + self.req = mock.Mock() self.req.environ = {'cinder.context': context.get_admin_context()} def test_update_serializer(self):