From 09f9937740808f44e7a4dd9705a0cd98c5024c51 Mon Sep 17 00:00:00 2001 From: Yuriy Nesenenko Date: Fri, 11 Dec 2015 15:07:10 +0200 Subject: [PATCH] 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 --- cinder/tests/unit/api/contrib/test_quotas.py | 6 ++---- cinder/tests/unit/api/contrib/test_quotas_classes.py | 4 ++-- 2 files changed, 4 insertions(+), 6 deletions(-) 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): -- 2.45.2