summaryrefslogtreecommitdiffstats
path: root/tests/test_backend_templated.py
diff options
context:
space:
mode:
authorDolph Mathews <dolph.mathews@gmail.com>2012-03-28 10:37:16 -0700
committerDolph Mathews <dolph.mathews@gmail.com>2012-06-27 11:47:24 -0500
commit23ca656927947dada40591bdd1badd5a531c2983 (patch)
tree4e3432245acbfc7b4adf5865a898d87fc0c10140 /tests/test_backend_templated.py
parent94f45dac5129e3394583703a3b496d8e160a0c43 (diff)
downloadkeystone-23ca656927947dada40591bdd1badd5a531c2983.tar.gz
keystone-23ca656927947dada40591bdd1badd5a531c2983.tar.xz
keystone-23ca656927947dada40591bdd1badd5a531c2983.zip
Refactor 404's into managers & drivers (bug 968519)
The goal is to move the responsibility of reference checks away from controllers and into the underlying managers & drivers, which can handle the task with equal or greater efficiency. - Tenant references from create_user/update_user are NOT tested due to inconsistencies between backends - Additional test coverage improvements Also fixes bug 999209, bug 999608, bug 1006029, bug 1006055, bug 1006287, bug 1006334, and bug 1006344. Change-Id: I7de592e7dd4518038436b9a9fdaab559b00a0537
Diffstat (limited to 'tests/test_backend_templated.py')
-rw-r--r--tests/test_backend_templated.py20
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/test_backend_templated.py b/tests/test_backend_templated.py
index 735b68b7..819cfd73 100644
--- a/tests/test_backend_templated.py
+++ b/tests/test_backend_templated.py
@@ -15,9 +15,12 @@
# under the License.
import os
+import uuid
+from keystone import exception
from keystone import test
from keystone.catalog.backends import templated as catalog_templated
+from keystone import catalog
import test_backend
import default_fixtures
@@ -50,8 +53,25 @@ class TestTemplatedCatalog(test.TestCase, test_backend.CatalogTests):
super(TestTemplatedCatalog, self).setUp()
self.opt_in_group('catalog', template_file=DEFAULT_CATALOG_TEMPLATES)
self.catalog_api = catalog_templated.TemplatedCatalog()
+ self.catalog_man = catalog.Manager()
self.load_fixtures(default_fixtures)
def test_get_catalog(self):
catalog_ref = self.catalog_api.get_catalog('foo', 'bar')
self.assertDictEqual(catalog_ref, self.DEFAULT_FIXTURE)
+
+ def test_create_endpoint_404(self):
+ self.assertRaises(exception.NotImplemented,
+ self.catalog_api.create_endpoint,
+ uuid.uuid4().hex,
+ {})
+
+ def test_get_endpoint_404(self):
+ self.assertRaises(exception.NotImplemented,
+ self.catalog_api.get_endpoint,
+ uuid.uuid4().hex)
+
+ def test_delete_endpoint_404(self):
+ self.assertRaises(exception.NotImplemented,
+ self.catalog_api.delete_endpoint,
+ uuid.uuid4().hex)