]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Replace use of mox with mock in test_quotas
authorYuriy Nesenenko <ynesenenko@mirantis.com>
Fri, 11 Dec 2015 13:07:10 +0000 (15:07 +0200)
committerYuriy Nesenenko <ynesenenko@mirantis.com>
Tue, 15 Dec 2015 13:51:00 +0000 (13:51 +0000)
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

cinder/tests/unit/api/contrib/test_quotas.py
cinder/tests/unit/api/contrib/test_quotas_classes.py

index 398f096d961500703fec65853a94d106f5f14f10..7f523e33b132b267642aef43f5ee881fea1de031 100644 (file)
@@ -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):
index 58a5ed18c22f846234c7658b5f338cae099826bd..7f39882b1232f179c8464bd119fb57520e133ae3 100644 (file)
@@ -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):