summaryrefslogtreecommitdiffstats
path: root/app/tests/test_database.py
diff options
context:
space:
mode:
authorBetzer, Rony (rb844h) <rb844h@intl.att.com>2018-10-04 16:47:13 +0300
committerMichael Lando <michael.lando@intl.att.com>2018-10-10 10:37:19 +0000
commit2236f9d810af0d2ef480eafbfa2abcc2b3cd932e (patch)
tree02a352f8aabcfee8a18f654b72d20919af84e43a /app/tests/test_database.py
parenta1cce5a9df1415309828944da3aa8a56e8f7d52e (diff)
UT coverage report with tox and virtualenv
UT coverage report with tox and virtualenv Change-Id: I90d6d4099e8cf43201082d5094865ee78c0bad9e Issue-ID: SDC-1756 Signed-off-by: Betzer, Rony (rb844h) <rb844h@intl.att.com>
Diffstat (limited to 'app/tests/test_database.py')
-rw-r--r--app/tests/test_database.py21
1 files changed, 21 insertions, 0 deletions
diff --git a/app/tests/test_database.py b/app/tests/test_database.py
new file mode 100644
index 0000000..fea520c
--- /dev/null
+++ b/app/tests/test_database.py
@@ -0,0 +1,21 @@
+import unittest
+from toscalib.templates.database import ToscaDB
+from tests.utils.test_utils import init_template
+
+
+class TestDatabaseMethods(unittest.TestCase):
+
+ def test_prepare_schema(self):
+ db = ToscaDB()
+ res = db._prepare_schema()
+ self.assertEqual(res, {'00_YAMLORDER_tosca_definitions_version': 'tosca_simple_yaml_1_0_0'})
+ db = init_template().db
+ res = db._prepare_schema()
+ self.assertEqual(res, {'00_YAMLORDER_tosca_definitions_version': 'tosca_simple_yaml_1_0_0', '08_YAMLORDER_capability_types': {'tosca.capabilities.dummy': {'properties': {'capabilityProperty': {'type': 'string'}}},
+ 'tosca.capabilities.substitute': {'properties': {'capabilityProperty': {'type': 'string'}}}}, '11_YAMLORDER_node_types': {'nodeTypeName': {'attributes': {'attributeName': {'type': 'string'}},
+ 'capabilities': {'capabilityName': {'type': 'tosca.capabilities.dummy'}}, 'id': 'nodeId', 'properties': {'propertyName': {'type': 'string'}}, 'requirements': [{'dummyRequirement': {'capability': 'tosca.capabilities.dummy'}}]},
+ 'substituteNodeType': {'capabilities': {'substituteCapability': {'type': 'tosca.capabilities.substitute'}}, 'id': 'subNodeId', 'properties': {'inputName': {'type': 'string'}}, 'requirements': [{'substituteRequirement': {'capability': 'tosca.capabilities.substitute'}}]}}})
+
+
+
+