Instance Validation tests, Added README.md files
Change-Id: Ie37545eb62d1ccd1e3db2c383b68a774d6c8be0e
diff --git a/src/test/cord-api/Framework/restApi.py b/src/test/cord-api/Framework/restApi.py
index 789bb6f..1889f21 100644
--- a/src/test/cord-api/Framework/restApi.py
+++ b/src/test/cord-api/Framework/restApi.py
@@ -154,8 +154,8 @@
#jsonGetData = test.ApiGet(key)
print "========="
#print jsonGetData
-#jsonEdit = test.ApiPut(key,{"c_tag" : "666","s_tag" : "123"},"7")
-jsonO = test.ApiDelete(key,"36")
+jsonEdit = test.ApiPut(key,{"c_tag" : "666","s_tag" : "123"},"30")
+#jsonO = test.ApiDelete(key,"36")
#jsonResponse = test.ApiPut(key,{"identity":{"name":"My House 22"}},"71")
#jsonResponse = test.ApiPost(key,{"name":"test-2"})
#jsonResponse = test.ApiPut(key,{"name":"test1-changed"},"9")
diff --git a/src/test/cord-api/Framework/utils/utils.py b/src/test/cord-api/Framework/utils/utils.py
index 04c94f9..7bedeff 100644
--- a/src/test/cord-api/Framework/utils/utils.py
+++ b/src/test/cord-api/Framework/utils/utils.py
@@ -139,16 +139,13 @@
@Returns: Returns the value of the Key that was provided
'''
def getFieldValueFromDict(self,search_dict, field):
- print "search_dict", search_dict, "field...", field
results = ''
found = False
input_keys = search_dict.keys()
for key in input_keys:
print "key...", key
if key == field:
- print "entered if..."
results = search_dict[key]
- print "results...", results
if not results:
found = True
break
@@ -174,6 +171,29 @@
input_dict[field]=field_value
return input_dict
+ '''
+ @method getAllFieldValues
+ @params : getJsonDataDictList - List of dictionaries to be searched
+ fieldName - Key to be searched for (ex: instance_id)
+ @Returns: Returns the unique value of the Key that was provided
+ '''
+
+ def getAllFieldValues(self, getJsonDataDictList, fieldName):
+ value_list = []
+ uniqValue = ''
+ uniq_list = []
+ for data in getJsonDataDictList:
+ fieldValue = ''
+ fieldValue = self.getFieldValueFromDict(data, fieldName)
+ value_list.append(fieldValue)
+ uniq_list = sorted(set(value_list))
+ if len(uniq_list) == 1:
+ uniqValue = uniq_list[0]
+ else:
+ print "list of values found for ", fieldName, ";", uniq_list
+ return fieldValue
+
+
'''
#Test
dict_list = {
@@ -203,6 +223,7 @@
#result = test.getDictFromListOfDict(dict_list,"email",21)
#result = test.getFieldValueFromDict(dict_list,"id")
#result = test.getDictFromListOfDict(dict_list,"account_num",21)
-result = test.setFieldValueInDict(input_dict,"subscriber",new_value)
+#result = test.setFieldValueInDict(input_dict,"subscriber",new_value)
+result = test.getAllFieldValues(list1,"instance_name")
print "finalllllll result....", result
'''