aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorChayal, Avteet (ac229e) <ac229e@att.com>2018-09-19 00:35:17 +0000
committerChayal, Avteet (ac229e) <ac229e@att.com>2018-09-19 20:10:36 +0000
commitd7eb44a65b37000d5d30245e6ac26bd68827804d (patch)
treeef0e6a3c092ca2518e671b56276bb9b6512fd2a0 /test
parentb84ac0be84c53d3a93b44b9a6ffc2d262e9b213a (diff)
CVS changes for osdf placment api
Implemented ONAP Common Versioning Strategy Issue-ID: OPTFRA-285 Change-Id: I31df699afddbeb8962b2ca0fa501eff45f70ed5d Signed-off-by: Chayal, Avteet (ac229e) <ac229e@att.com>
Diffstat (limited to 'test')
-rwxr-xr-xtest/test_api_data_utils.py21
1 files changed, 21 insertions, 0 deletions
diff --git a/test/test_api_data_utils.py b/test/test_api_data_utils.py
new file mode 100755
index 0000000..99d7a2e
--- /dev/null
+++ b/test/test_api_data_utils.py
@@ -0,0 +1,21 @@
+import json
+import os
+from osdf.utils import api_data_utils
+from collections import defaultdict
+
+
+BASE_DIR = os.path.dirname(__file__)
+
+with open(os.path.join(BASE_DIR, "placement-tests/request.json")) as json_data:
+ req_json = json.load(json_data)
+
+class TestVersioninfo():
+#
+# Tests for api_data_utils.py
+#
+ def test_retrieve_version_info(self):
+ request_id = 'test12345'
+ test_dict = {'placementVersioningEnabled': False, 'placementMajorVersion': '1', 'placementPatchVersion': '0', 'placementMinorVersion': '0'}
+ test_verison_info_dict = defaultdict(dict ,test_dict )
+ verison_info_dict = api_data_utils.retrieve_version_info(req_json, request_id)
+ assert verison_info_dict == test_verison_info_dict \ No newline at end of file