Browse Source

Merge "Use keystoneauth only in applicable test"

Zuul 7 months ago
parent
commit
b6ac042ece
2 changed files with 4 additions and 4 deletions
  1. 0
    4
      os_service_types/tests/base.py
  2. 4
    0
      os_service_types/tests/test_remote.py

+ 0
- 4
os_service_types/tests/base.py View File

@@ -18,7 +18,6 @@
18 18
 import copy
19 19
 import datetime
20 20
 
21
-import keystoneauth1.session
22 21
 from oslotest import base
23 22
 
24 23
 import os_service_types.service_types
@@ -30,9 +29,6 @@ class TestCase(base.BaseTestCase):
30 29
     def setUp(self):
31 30
         super(TestCase, self).setUp()
32 31
 
33
-        # use keystoneauth1 to get a Sessiom with no auth information
34
-        self.session = keystoneauth1.session.Session()
35
-
36 32
         self.builtin_content = os_service_types.service_types.BUILTIN_DATA
37 33
         self.builtin_version = self.builtin_content['version']
38 34
 

+ 4
- 0
os_service_types/tests/test_remote.py View File

@@ -24,6 +24,8 @@ available in these tests.
24 24
 from requests_mock.contrib import fixture as rm_fixture
25 25
 from testscenarios import load_tests_apply_scenarios as load_tests  # noqa
26 26
 
27
+import keystoneauth1.session
28
+
27 29
 import os_service_types
28 30
 import os_service_types.service_types
29 31
 from os_service_types.tests import base
@@ -39,6 +41,8 @@ class TestRemote(base.TestCase, base.ServiceDataMixin):
39 41
             'GET', os_service_types.service_types.SERVICE_TYPES_URL,
40 42
             json=self.remote_content,
41 43
             headers={'etag': self.getUniqueString('etag')})
44
+        # use keystoneauth1 to get a Sessiom with no auth information
45
+        self.session = keystoneauth1.session.Session()
42 46
         # Make an object that fetches from the network
43 47
         self.service_types = os_service_types.ServiceTypes(
44 48
             session=self.session)

Loading…
Cancel
Save