aboutsummaryrefslogtreecommitdiffstats
path: root/keystone-moon/keystone/tests/unit/test_backend_kvs.py
diff options
context:
space:
mode:
Diffstat (limited to 'keystone-moon/keystone/tests/unit/test_backend_kvs.py')
-rw-r--r--keystone-moon/keystone/tests/unit/test_backend_kvs.py66
1 files changed, 5 insertions, 61 deletions
diff --git a/keystone-moon/keystone/tests/unit/test_backend_kvs.py b/keystone-moon/keystone/tests/unit/test_backend_kvs.py
index 7406192a..36af1c36 100644
--- a/keystone-moon/keystone/tests/unit/test_backend_kvs.py
+++ b/keystone-moon/keystone/tests/unit/test_backend_kvs.py
@@ -14,20 +14,17 @@
import datetime
import uuid
-from oslo_config import cfg
from oslo_utils import timeutils
import six
from keystone.common import utils
from keystone import exception
from keystone.tests import unit
-from keystone.tests.unit import test_backend
+from keystone.tests.unit.ksfixtures import database
+from keystone.tests.unit.token import test_backends as token_tests
-CONF = cfg.CONF
-
-
-class KvsToken(unit.TestCase, test_backend.TokenTests):
+class KvsToken(unit.TestCase, token_tests.TokenTests):
def setUp(self):
super(KvsToken, self).setUp()
self.load_backends()
@@ -103,64 +100,11 @@ class KvsToken(unit.TestCase, test_backend.TokenTests):
self.assertEqual(expected_user_token_list, user_token_list)
-class KvsCatalog(unit.TestCase, test_backend.CatalogTests):
- def setUp(self):
- super(KvsCatalog, self).setUp()
- self.load_backends()
- self._load_fake_catalog()
-
- def config_overrides(self):
- super(KvsCatalog, self).config_overrides()
- self.config_fixture.config(group='catalog', driver='kvs')
-
- def _load_fake_catalog(self):
- self.catalog_foobar = self.catalog_api.driver._create_catalog(
- 'foo', 'bar',
- {'RegionFoo': {'service_bar': {'foo': 'bar'}}})
-
- def test_get_catalog_404(self):
- # FIXME(dolph): this test should be moved up to test_backend
- # FIXME(dolph): exceptions should be UserNotFound and ProjectNotFound
- self.assertRaises(exception.NotFound,
- self.catalog_api.get_catalog,
- uuid.uuid4().hex,
- 'bar')
-
- self.assertRaises(exception.NotFound,
- self.catalog_api.get_catalog,
- 'foo',
- uuid.uuid4().hex)
-
- def test_get_catalog(self):
- catalog_ref = self.catalog_api.get_catalog('foo', 'bar')
- self.assertDictEqual(catalog_ref, self.catalog_foobar)
-
- def test_get_catalog_endpoint_disabled(self):
- # This test doesn't apply to KVS because with the KVS backend the
- # application creates the catalog (including the endpoints) for each
- # user and project. Whether endpoints are enabled or disabled isn't
- # a consideration.
- f = super(KvsCatalog, self).test_get_catalog_endpoint_disabled
- self.assertRaises(exception.NotFound, f)
-
- def test_get_v3_catalog_endpoint_disabled(self):
- # There's no need to have disabled endpoints in the kvs catalog. Those
- # endpoints should just be removed from the store. This just tests
- # what happens currently when the super impl is called.
- f = super(KvsCatalog, self).test_get_v3_catalog_endpoint_disabled
- self.assertRaises(exception.NotFound, f)
-
- def test_list_regions_filtered_by_parent_region_id(self):
- self.skipTest('KVS backend does not support hints')
-
- def test_service_filtering(self):
- self.skipTest("kvs backend doesn't support filtering")
-
-
class KvsTokenCacheInvalidation(unit.TestCase,
- test_backend.TokenCacheInvalidation):
+ token_tests.TokenCacheInvalidation):
def setUp(self):
super(KvsTokenCacheInvalidation, self).setUp()
+ self.useFixture(database.Database(self.sql_driver_version_overrides))
self.load_backends()
self._create_test_data()