Cord Api Test directory structure and template files
Change-Id: Ib584b291ec1b4286c179991f2916c6e2cf7642a9
diff --git a/src/test/cord-api/Framework/utils/readProperties.py b/src/test/cord-api/Framework/utils/readProperties.py
new file mode 100644
index 0000000..6bd8c6f
--- /dev/null
+++ b/src/test/cord-api/Framework/utils/readProperties.py
@@ -0,0 +1,33 @@
+import sys
+
+class readProperties(object):
+ def __init__(self, strPropertiesFile):
+ self.strPropertiesFile = strPropertiesFile
+
+ @staticmethod
+ def parse_line(input):
+ key, value = input.split('=')
+ key = key.strip()
+ value = value.strip()
+ return key, value
+
+ @staticmethod
+ def getProperties(self):
+ data = {}
+
+ with open(self.strPropertiesFile) as fp:
+ for line in fp:
+ line = line.strip()
+ if not line or line.startswith('#') or line.startswith('import'):
+ continue
+
+ key, value = readProperties.parse_line(line)
+ data[key] = value
+
+ return data
+
+ def getValueProperties(self, key):
+ datas = readProperties.getProperties(self)
+ value = datas[key]
+
+ return value
diff --git a/src/test/cord-api/Framework/utils/utils.py b/src/test/cord-api/Framework/utils/utils.py
new file mode 100644
index 0000000..5c4efb5
--- /dev/null
+++ b/src/test/cord-api/Framework/utils/utils.py
@@ -0,0 +1,29 @@
+import pexpect,os
+import time
+import json
+import collections
+import sys
+import robot
+import os.path
+from os.path import expanduser
+
+class utils(object):
+
+ @staticmethod
+ def listToDict(alist, intListIndex):
+ dictInfo = alist[int(intListIndex)]
+ return dictInfo
+
+ @staticmethod
+ def jsonToList(strFile, strListName):
+ data = json.loads(open(strFile).read())
+ #print "data...",data
+ dataList = data[strListName]
+ return dataList
+
+#Test
+#test = utils()
+#data=test.jsonToList("Subscribers.json","SubscriberInfo")
+#print test.jsonToList("Subscribers.json","SubscriberInfo")
+#print "index 1...",test.listToDict(data,1)
+