summaryrefslogtreecommitdiffstats
path: root/keystone-moon/keystone/tests/moon/backends/test_sql_backend.py
diff options
context:
space:
mode:
authorasteroide <thomas.duval@orange.com>2015-07-31 16:49:31 +0200
committerasteroide <thomas.duval@orange.com>2015-07-31 16:50:09 +0200
commit51f7872f4902093cb0f0d445737c5892dd784191 (patch)
tree6eec61906e26b38b4c911ff9821e3557e038c691 /keystone-moon/keystone/tests/moon/backends/test_sql_backend.py
parente43444c05416190123ad66ffc3ffe9ee27f6936c (diff)
Play unit tests and modify code accordingly. (some tests are still not OK).
Change-Id: I021081710411be12ffbbb0a3c8192626dbf9f8ce
Diffstat (limited to 'keystone-moon/keystone/tests/moon/backends/test_sql_backend.py')
-rw-r--r--keystone-moon/keystone/tests/moon/backends/test_sql_backend.py43
1 files changed, 43 insertions, 0 deletions
diff --git a/keystone-moon/keystone/tests/moon/backends/test_sql_backend.py b/keystone-moon/keystone/tests/moon/backends/test_sql_backend.py
new file mode 100644
index 00000000..27b8d3a0
--- /dev/null
+++ b/keystone-moon/keystone/tests/moon/backends/test_sql_backend.py
@@ -0,0 +1,43 @@
+# Copyright 2015 Open Platform for NFV Project, Inc. and its contributors
+# This software is distributed under the terms and conditions of the 'Apache-2.0'
+# license which can be found in the file 'LICENSE' in this package distribution
+# or at 'http://www.apache.org/licenses/LICENSE-2.0'.
+
+"""Unit tests for core configuration."""
+
+import uuid
+from oslo_config import cfg
+from keystone.tests import unit as tests
+from keystone.contrib.moon.backends import sql
+from keystone.tests.unit.ksfixtures import database
+from keystone.contrib.moon.exception import *
+from keystone.tests.unit import default_fixtures
+from keystone.contrib.moon.core import LogManager
+
+CONF = cfg.CONF
+
+
+class TestSQL(tests.TestCase):
+
+ def setUp(self):
+ self.useFixture(database.Database())
+ super(TestSQL, self).setUp()
+ self.load_backends()
+ self.load_fixtures(default_fixtures)
+ self.driver = sql.IntraExtensionConnector()
+
+ def load_extra_backends(self):
+ return {
+ "moonlog_api": LogManager()
+ }
+
+ def config_overrides(self):
+ super(TestSQL, self).config_overrides()
+ self.config_fixture.config(
+ group='moon',
+ tenant_driver='keystone.contrib.moon.backends.sql.ConfigurationConnector')
+
+ def test_intra_extensions(self):
+ result = self.driver.get_intra_extensions_dict()
+ print(type(result))
+ self.assertIn("toto", result)