From e85c6b6193e6653989b8652ba75de887b733513f Mon Sep 17 00:00:00 2001 From: Ding Jin Date: Thu, 5 Jul 2018 08:56:16 -0400 Subject: [PATCH] Move load_auth_fixtures() Move load_auth_fixtures() to the BaseTest class. Change-Id: I838848114acd8a2e24f89b0cf748eeb19738050f --- mixmatch/tests/unit/base.py | 2 ++ mixmatch/tests/unit/test_images.py | 4 ---- mixmatch/tests/unit/test_volumes.py | 8 -------- 3 files changed, 2 insertions(+), 12 deletions(-) diff --git a/mixmatch/tests/unit/base.py b/mixmatch/tests/unit/base.py index a84b19e..c77f726 100644 --- a/mixmatch/tests/unit/base.py +++ b/mixmatch/tests/unit/base.py @@ -64,6 +64,8 @@ class BaseTest(testcase.TestCase): config.post_config() extend.load_extensions() + self.load_auth_fixtures() + def load_auth_fixtures(self): self.auth = FakeSession(token=uuid.uuid4().hex, project=uuid.uuid4().hex) diff --git a/mixmatch/tests/unit/test_images.py b/mixmatch/tests/unit/test_images.py index b95d61b..7775144 100644 --- a/mixmatch/tests/unit/test_images.py +++ b/mixmatch/tests/unit/test_images.py @@ -24,10 +24,6 @@ from mixmatch.model import insert, ResourceMapping class TestImages(base.BaseTest): def setUp(self): super(TestImages, self).setUp() - # TODO(ericjuma): load_auth_fixtures() should be done in the base - # class, but may conflict with the other tests which haven't been - # migrated to these fixtures. - self.load_auth_fixtures() def _construct_url(self, image_id='', sp=None): if not sp: diff --git a/mixmatch/tests/unit/test_volumes.py b/mixmatch/tests/unit/test_volumes.py index 427e879..4afd4ca 100644 --- a/mixmatch/tests/unit/test_volumes.py +++ b/mixmatch/tests/unit/test_volumes.py @@ -24,10 +24,6 @@ from mixmatch.tests.unit import samples class TestVolumesV3(base.BaseTest): def setUp(self): super(TestVolumesV3, self).setUp() - # TODO(knikolla): load_auth_fixtures() should be done in the base - # class, but may conflict with the other tests which haven't been - # migrated to these fixtures. - self.load_auth_fixtures() def _construct_url(self, auth=None, target=None, sp=None, resource_type='volumes'): @@ -89,10 +85,6 @@ class TestVolumesV3(base.BaseTest): class TestVolumesV2(base.BaseTest): def setUp(self): super(TestVolumesV2, self).setUp() - # TODO(knikolla): load_auth_fixtures() should be done in the base - # class, but may conflict with the other tests which haven't been - # migrated to these fixtures. - self.load_auth_fixtures() def _construct_url(self, auth=None, target=None, sp=None): if not sp: