summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDing Jin <kjinlokm@gmail.com>2018-07-05 08:56:16 -0400
committerDing Jin <kjinlokm@gmail.com>2018-07-05 09:10:17 -0400
commite85c6b6193e6653989b8652ba75de887b733513f (patch)
treefa6d858b01004e841bca5d73ae9aa4cd4599ba8b
parentfd5e5d3e42272b6c109aa9f32399b43b93517355 (diff)
Move load_auth_fixtures()
Move load_auth_fixtures() to the BaseTest class. Change-Id: I838848114acd8a2e24f89b0cf748eeb19738050f
Notes
Notes (review): Code-Review+2: Kristi Nikolla <kristi@nikolla.me> Workflow+1: Kristi Nikolla <kristi@nikolla.me> Verified+2: Zuul Submitted-by: Zuul Submitted-at: Thu, 05 Jul 2018 21:57:19 +0000 Reviewed-on: https://review.openstack.org/580372 Project: openstack/mixmatch Branch: refs/heads/master
-rw-r--r--mixmatch/tests/unit/base.py2
-rw-r--r--mixmatch/tests/unit/test_images.py4
-rw-r--r--mixmatch/tests/unit/test_volumes.py8
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):
64 config.post_config() 64 config.post_config()
65 extend.load_extensions() 65 extend.load_extensions()
66 66
67 self.load_auth_fixtures()
68
67 def load_auth_fixtures(self): 69 def load_auth_fixtures(self):
68 self.auth = FakeSession(token=uuid.uuid4().hex, 70 self.auth = FakeSession(token=uuid.uuid4().hex,
69 project=uuid.uuid4().hex) 71 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
24class TestImages(base.BaseTest): 24class TestImages(base.BaseTest):
25 def setUp(self): 25 def setUp(self):
26 super(TestImages, self).setUp() 26 super(TestImages, self).setUp()
27 # TODO(ericjuma): load_auth_fixtures() should be done in the base
28 # class, but may conflict with the other tests which haven't been
29 # migrated to these fixtures.
30 self.load_auth_fixtures()
31 27
32 def _construct_url(self, image_id='', sp=None): 28 def _construct_url(self, image_id='', sp=None):
33 if not sp: 29 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
24class TestVolumesV3(base.BaseTest): 24class TestVolumesV3(base.BaseTest):
25 def setUp(self): 25 def setUp(self):
26 super(TestVolumesV3, self).setUp() 26 super(TestVolumesV3, self).setUp()
27 # TODO(knikolla): load_auth_fixtures() should be done in the base
28 # class, but may conflict with the other tests which haven't been
29 # migrated to these fixtures.
30 self.load_auth_fixtures()
31 27
32 def _construct_url(self, auth=None, target=None, sp=None, 28 def _construct_url(self, auth=None, target=None, sp=None,
33 resource_type='volumes'): 29 resource_type='volumes'):
@@ -89,10 +85,6 @@ class TestVolumesV3(base.BaseTest):
89class TestVolumesV2(base.BaseTest): 85class TestVolumesV2(base.BaseTest):
90 def setUp(self): 86 def setUp(self):
91 super(TestVolumesV2, self).setUp() 87 super(TestVolumesV2, self).setUp()
92 # TODO(knikolla): load_auth_fixtures() should be done in the base
93 # class, but may conflict with the other tests which haven't been
94 # migrated to these fixtures.
95 self.load_auth_fixtures()
96 88
97 def _construct_url(self, auth=None, target=None, sp=None): 89 def _construct_url(self, auth=None, target=None, sp=None):
98 if not sp: 90 if not sp: