Skip to content

Commit

Permalink
This should work better, and by better I mean correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
Wolfe1 committed Feb 17, 2022
1 parent aebb0db commit 936226d
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 11 deletions.
2 changes: 1 addition & 1 deletion docs/APILibraryDocumentation.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/DesktopLibraryDocumentation.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/GUILibraryDocumentation.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/MobileLibraryDocumentation.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/SOAPLibraryDocumentation.html
Original file line number Diff line number Diff line change
Expand Up @@ -1102,7 +1102,7 @@
jQuery.extend({highlight:function(e,t,n,r){if(e.nodeType===3){var i=e.data.match(t);if(i){var s=document.createElement(n||"span");s.className=r||"highlight";var o=e.splitText(i.index);o.splitText(i[0].length);var u=o.cloneNode(true);s.appendChild(u);o.parentNode.replaceChild(s,o);return 1}}else if(e.nodeType===1&&e.childNodes&&!/(script|style)/i.test(e.tagName)&&!(e.tagName===n.toUpperCase()&&e.className===r)){for(var a=0;a<e.childNodes.length;a++){a+=jQuery.highlight(e.childNodes[a],t,n,r)}}return 0}});jQuery.fn.unhighlight=function(e){var t={className:"highlight",element:"span"};jQuery.extend(t,e);return this.find(t.element+"."+t.className).each(function(){var e=this.parentNode;e.replaceChild(this.firstChild,this);e.normalize()}).end()};jQuery.fn.highlight=function(e,t){var n={className:"highlight",element:"span",caseSensitive:false,wordsOnly:false};jQuery.extend(n,t);if(e.constructor===String){e=[e]}e=jQuery.grep(e,function(e,t){return e!=""});e=jQuery.map(e,function(e,t){return e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")});if(e.length==0){return this}var r=n.caseSensitive?"":"i";var i="("+e.join("|")+")";if(n.wordsOnly){i="\\b"+i+"\\b"}var s=new RegExp(i,r);return this.each(function(){jQuery.highlight(this,s,n.element,n.className)})}
</script>
<script type="text/javascript">
libdoc = {"name": "SOAP_Library", "doc": "<p>Zoomba SOAP Library</p>\n<p>This class is the base Library used to generate automated SOAP Tests in the Zoomba Automation Framework.</p>", "version": "2.13.2", "generated": "2022-02-17 13:22:52", "type": "LIBRARY", "scope": "TEST", "docFormat": "HTML", "source": "C:\\Git\\robotframework-zoomba\\src\\Zoomba\\SOAPLibrary.py", "lineno": 43, "tags": [], "inits": [], "keywords": [{"name": "Call Soap Method With List Object", "args": [{"name": "action", "types": [], "defaultValue": "None", "kind": "POSITIONAL_OR_NAMED", "required": false, "repr": "action=None"}, {"name": "soap_object", "types": [], "defaultValue": "None", "kind": "POSITIONAL_OR_NAMED", "required": false, "repr": "soap_object=None"}], "doc": "<p>Call Soap Method. Calls soap method with list object</p>\n<p>action: (string) SOAP Action to be called.</p>\n<p>soap_object: (list) Soap Object in list format, list must be ordered wrt schema</p>", "shortdoc": "Call Soap Method. Calls soap method with list object ", "tags": [], "source": "C:\\Git\\robotframework-zoomba\\src\\Zoomba\\SOAPLibrary.py", "lineno": 100}, {"name": "Call Soap Method With Object", "args": [{"name": "action", "types": [], "defaultValue": "None", "kind": "POSITIONAL_OR_NAMED", "required": false, "repr": "action=None"}, {"name": "soap_object", "types": [], "defaultValue": null, "kind": "VAR_NAMED", "required": false, "repr": "**soap_object"}], "doc": "<p>Call Soap Method with dictionary object. Calls soap method</p>\n<p>action: (string) SOAP Action to be called.</p>\n<p>soap_object: (dict) Soap Object in dict format, dict must contain all required parts of schema object.</p>", "shortdoc": "Call Soap Method with dictionary object. Calls soap method ", "tags": [], "source": "C:\\Git\\robotframework-zoomba\\src\\Zoomba\\SOAPLibrary.py", "lineno": 109}, {"name": "Convert Soap Response To Json", "args": [{"name": "soap_response", "types": [], "defaultValue": "None", "kind": "POSITIONAL_OR_NAMED", "required": false, "repr": "soap_response=None"}], "doc": "<p>Convert Soap Response To Dictionary: This keyword builds a dictionary from the sudsLibrary response</p>\n<p>json_actual_response: (request response object) The response from an API.</p>\n<p>return: There is no actual returned output, other than error messages when comparisons fail.</p>", "shortdoc": "Convert Soap Response To Dictionary: This keyword builds a dictionary from the sudsLibrary response", "tags": [], "source": "C:\\Git\\robotframework-zoomba\\src\\Zoomba\\SOAPLibrary.py", "lineno": 138}, {"name": "Create Soap Session", "args": [{"name": "host", "types": [], "defaultValue": "None", "kind": "POSITIONAL_OR_NAMED", "required": false, "repr": "host=None"}, {"name": "endpoint", "types": [], "defaultValue": "None", "kind": "POSITIONAL_OR_NAMED", "required": false, "repr": "endpoint=None"}, {"name": "alias", "types": [], "defaultValue": "None", "kind": "POSITIONAL_OR_NAMED", "required": false, "repr": "alias=None"}, {"name": "kwargs", "types": [], "defaultValue": null, "kind": "VAR_NAMED", "required": false, "repr": "**kwargs"}], "doc": "<p>Create Soap Session. This Keyword utilizes the WSDL to create a soap client.</p>\n<p>host: (string) The host url.</p>\n<p>endpoint: (string) SOAP API endpoint containing the actions to be referenced.</p>\n<p>**kwargs: (optional) Parameters that could be included to add options to client creation. Current supported parameters are:</p>\n<p>set_location: http address</p>", "shortdoc": "Create Soap Session. This Keyword utilizes the WSDL to create a soap client.", "tags": [], "source": "C:\\Git\\robotframework-zoomba\\src\\Zoomba\\SOAPLibrary.py", "lineno": 68}, {"name": "Create Soap Session And Fix Wsdl", "args": [{"name": "host", "types": [], "defaultValue": "None", "kind": "POSITIONAL_OR_NAMED", "required": false, "repr": "host=None"}, {"name": "endpoint", "types": [], "defaultValue": "None", "kind": "POSITIONAL_OR_NAMED", "required": false, "repr": "endpoint=None"}, {"name": "alias", "types": [], "defaultValue": "None", "kind": "POSITIONAL_OR_NAMED", "required": false, "repr": "alias=None"}, {"name": "kwargs", "types": [], "defaultValue": null, "kind": "VAR_NAMED", "required": false, "repr": "**kwargs"}], "doc": "<p>Create Soap Session. This Keyword utilizes the WSDL and directly accesses calls from sudsLibrary.</p>\n<p>host: (string) The host url.</p>\n<p>endpoint: (string) SOAP API endpoint containing the actions to be referenced.</p>\n<p>alias: (string} Sets the alias for the SudsLibrary Framework **kwargs: (optional) Parameters that could be included to add options to client creation. Current supported parameters are:</p>\n<p>set_location: http address</p>", "shortdoc": "Create Soap Session. This Keyword utilizes the WSDL and directly accesses calls from sudsLibrary.", "tags": [], "source": "C:\\Git\\robotframework-zoomba\\src\\Zoomba\\SOAPLibrary.py", "lineno": 51}, {"name": "Create Soap Session And Set Location", "args": [{"name": "host", "types": [], "defaultValue": "None", "kind": "POSITIONAL_OR_NAMED", "required": false, "repr": "host=None"}, {"name": "endpoint", "types": [], "defaultValue": "None", "kind": "POSITIONAL_OR_NAMED", "required": false, "repr": "endpoint=None"}, {"name": "alias", "types": [], "defaultValue": "None", "kind": "POSITIONAL_OR_NAMED", "required": false, "repr": "alias=None"}, {"name": "set_location", "types": [], "defaultValue": "None", "kind": "POSITIONAL_OR_NAMED", "required": false, "repr": "set_location=None"}, {"name": "fix", "types": [], "defaultValue": "False", "kind": "POSITIONAL_OR_NAMED", "required": false, "repr": "fix=False"}], "doc": "<p>Create Soap Session and Set Location. In addition to the client creation, this keyword sets the location as specified.</p>\n<p>host: (string) The host url.</p>\n<p>endpoint: (string) SOAP API endpoint containing the actions to be referenced.</p>\n<p>set_location: (string) If set will overwrite the WSDL location with specified address.</p>\n<p>If set to None will replace location with host and endpoint specified</p>", "shortdoc": "Create Soap Session and Set Location. In addition to the client creation, this keyword sets the location as specified.", "tags": [], "source": "C:\\Git\\robotframework-zoomba\\src\\Zoomba\\SOAPLibrary.py", "lineno": 84}, {"name": "Create Wsdl Objects", "args": [{"name": "wsdl_type", "types": [], "defaultValue": "None", "kind": "POSITIONAL_OR_NAMED", "required": false, "repr": "wsdl_type=None"}, {"name": "object_dict", "types": [], "defaultValue": "None", "kind": "POSITIONAL_OR_NAMED", "required": false, "repr": "object_dict=None"}], "doc": "<p>Create Wsdl Objects. This Keyword utilizes the WSDL to create a WSDL object based on the information provided.</p>\n<p>wsdl_type: (string) Wsdl object to be created.</p>\n<p>object_dict: (dict) Python Dictionary containing values and nested dictionaries with construction similar to wsdl defined objects.</p>\n<p>return: (response object) Returns the SOAP client object.</p>", "shortdoc": "Create Wsdl Objects. This Keyword utilizes the WSDL to create a WSDL object based on the information provided.", "tags": [], "source": "C:\\Git\\robotframework-zoomba\\src\\Zoomba\\SOAPLibrary.py", "lineno": 124}], "dataTypes": {"enums": [], "typedDicts": []}}
libdoc = {"name": "SOAP_Library", "doc": "<p>Zoomba SOAP Library</p>\n<p>This class is the base Library used to generate automated SOAP Tests in the Zoomba Automation Framework.</p>", "version": "2.13.2", "generated": "2022-02-17 14:27:19", "type": "LIBRARY", "scope": "TEST", "docFormat": "HTML", "source": "C:\\Git\\robotframework-zoomba\\src\\Zoomba\\SOAPLibrary.py", "lineno": 43, "tags": [], "inits": [], "keywords": [{"name": "Call Soap Method With List Object", "args": [{"name": "action", "types": [], "defaultValue": "None", "kind": "POSITIONAL_OR_NAMED", "required": false, "repr": "action=None"}, {"name": "soap_object", "types": [], "defaultValue": "None", "kind": "POSITIONAL_OR_NAMED", "required": false, "repr": "soap_object=None"}], "doc": "<p>Call Soap Method. Calls soap method with list object</p>\n<p>action: (string) SOAP Action to be called.</p>\n<p>soap_object: (list) Soap Object in list format, list must be ordered wrt schema</p>", "shortdoc": "Call Soap Method. Calls soap method with list object ", "tags": [], "source": "C:\\Git\\robotframework-zoomba\\src\\Zoomba\\SOAPLibrary.py", "lineno": 100}, {"name": "Call Soap Method With Object", "args": [{"name": "action", "types": [], "defaultValue": "None", "kind": "POSITIONAL_OR_NAMED", "required": false, "repr": "action=None"}, {"name": "soap_object", "types": [], "defaultValue": null, "kind": "VAR_NAMED", "required": false, "repr": "**soap_object"}], "doc": "<p>Call Soap Method with dictionary object. Calls soap method</p>\n<p>action: (string) SOAP Action to be called.</p>\n<p>soap_object: (dict) Soap Object in dict format, dict must contain all required parts of schema object.</p>", "shortdoc": "Call Soap Method with dictionary object. Calls soap method ", "tags": [], "source": "C:\\Git\\robotframework-zoomba\\src\\Zoomba\\SOAPLibrary.py", "lineno": 109}, {"name": "Convert Soap Response To Json", "args": [{"name": "soap_response", "types": [], "defaultValue": "None", "kind": "POSITIONAL_OR_NAMED", "required": false, "repr": "soap_response=None"}], "doc": "<p>Convert Soap Response To Dictionary: This keyword builds a dictionary from the sudsLibrary response</p>\n<p>json_actual_response: (request response object) The response from an API.</p>\n<p>return: There is no actual returned output, other than error messages when comparisons fail.</p>", "shortdoc": "Convert Soap Response To Dictionary: This keyword builds a dictionary from the sudsLibrary response", "tags": [], "source": "C:\\Git\\robotframework-zoomba\\src\\Zoomba\\SOAPLibrary.py", "lineno": 138}, {"name": "Create Soap Session", "args": [{"name": "host", "types": [], "defaultValue": "None", "kind": "POSITIONAL_OR_NAMED", "required": false, "repr": "host=None"}, {"name": "endpoint", "types": [], "defaultValue": "None", "kind": "POSITIONAL_OR_NAMED", "required": false, "repr": "endpoint=None"}, {"name": "alias", "types": [], "defaultValue": "None", "kind": "POSITIONAL_OR_NAMED", "required": false, "repr": "alias=None"}, {"name": "kwargs", "types": [], "defaultValue": null, "kind": "VAR_NAMED", "required": false, "repr": "**kwargs"}], "doc": "<p>Create Soap Session. This Keyword utilizes the WSDL to create a soap client.</p>\n<p>host: (string) The host url.</p>\n<p>endpoint: (string) SOAP API endpoint containing the actions to be referenced.</p>\n<p>**kwargs: (optional) Parameters that could be included to add options to client creation. Current supported parameters are:</p>\n<p>set_location: http address</p>", "shortdoc": "Create Soap Session. This Keyword utilizes the WSDL to create a soap client.", "tags": [], "source": "C:\\Git\\robotframework-zoomba\\src\\Zoomba\\SOAPLibrary.py", "lineno": 68}, {"name": "Create Soap Session And Fix Wsdl", "args": [{"name": "host", "types": [], "defaultValue": "None", "kind": "POSITIONAL_OR_NAMED", "required": false, "repr": "host=None"}, {"name": "endpoint", "types": [], "defaultValue": "None", "kind": "POSITIONAL_OR_NAMED", "required": false, "repr": "endpoint=None"}, {"name": "alias", "types": [], "defaultValue": "None", "kind": "POSITIONAL_OR_NAMED", "required": false, "repr": "alias=None"}, {"name": "kwargs", "types": [], "defaultValue": null, "kind": "VAR_NAMED", "required": false, "repr": "**kwargs"}], "doc": "<p>Create Soap Session. This Keyword utilizes the WSDL and directly accesses calls from sudsLibrary.</p>\n<p>host: (string) The host url.</p>\n<p>endpoint: (string) SOAP API endpoint containing the actions to be referenced.</p>\n<p>alias: (string} Sets the alias for the SudsLibrary Framework **kwargs: (optional) Parameters that could be included to add options to client creation. Current supported parameters are:</p>\n<p>set_location: http address</p>", "shortdoc": "Create Soap Session. This Keyword utilizes the WSDL and directly accesses calls from sudsLibrary.", "tags": [], "source": "C:\\Git\\robotframework-zoomba\\src\\Zoomba\\SOAPLibrary.py", "lineno": 51}, {"name": "Create Soap Session And Set Location", "args": [{"name": "host", "types": [], "defaultValue": "None", "kind": "POSITIONAL_OR_NAMED", "required": false, "repr": "host=None"}, {"name": "endpoint", "types": [], "defaultValue": "None", "kind": "POSITIONAL_OR_NAMED", "required": false, "repr": "endpoint=None"}, {"name": "alias", "types": [], "defaultValue": "None", "kind": "POSITIONAL_OR_NAMED", "required": false, "repr": "alias=None"}, {"name": "set_location", "types": [], "defaultValue": "None", "kind": "POSITIONAL_OR_NAMED", "required": false, "repr": "set_location=None"}, {"name": "fix", "types": [], "defaultValue": "False", "kind": "POSITIONAL_OR_NAMED", "required": false, "repr": "fix=False"}], "doc": "<p>Create Soap Session and Set Location. In addition to the client creation, this keyword sets the location as specified.</p>\n<p>host: (string) The host url.</p>\n<p>endpoint: (string) SOAP API endpoint containing the actions to be referenced.</p>\n<p>set_location: (string) If set will overwrite the WSDL location with specified address.</p>\n<p>If set to None will replace location with host and endpoint specified</p>", "shortdoc": "Create Soap Session and Set Location. In addition to the client creation, this keyword sets the location as specified.", "tags": [], "source": "C:\\Git\\robotframework-zoomba\\src\\Zoomba\\SOAPLibrary.py", "lineno": 84}, {"name": "Create Wsdl Objects", "args": [{"name": "wsdl_type", "types": [], "defaultValue": "None", "kind": "POSITIONAL_OR_NAMED", "required": false, "repr": "wsdl_type=None"}, {"name": "object_dict", "types": [], "defaultValue": "None", "kind": "POSITIONAL_OR_NAMED", "required": false, "repr": "object_dict=None"}], "doc": "<p>Create Wsdl Objects. This Keyword utilizes the WSDL to create a WSDL object based on the information provided.</p>\n<p>wsdl_type: (string) Wsdl object to be created.</p>\n<p>object_dict: (dict) Python Dictionary containing values and nested dictionaries with construction similar to wsdl defined objects.</p>\n<p>return: (response object) Returns the SOAP client object.</p>", "shortdoc": "Create Wsdl Objects. This Keyword utilizes the WSDL to create a WSDL object based on the information provided.", "tags": [], "source": "C:\\Git\\robotframework-zoomba\\src\\Zoomba\\SOAPLibrary.py", "lineno": 124}], "dataTypes": {"enums": [], "typedDicts": []}}
</script>
<title></title>
</head>
Expand Down
18 changes: 13 additions & 5 deletions src/Zoomba/APILibrary.py
Original file line number Diff line number Diff line change
Expand Up @@ -337,11 +337,19 @@ def _key_by_key_list(self, key, value, actual_dictionary, unmatched_keys_list=No
parent_key=None, full_list_validation=False, sort_lists=False, **kwargs):
for index, item in enumerate(value):
if isinstance(item, str):
if value != actual_dictionary[key] and not sort_lists:
zoomba.fail("Arrays do not match:" + \
"\nExpected: " + str(value) + \
"\nActual: " + str(actual_dictionary[key]))
continue
if value != actual_dictionary[key]:
if sort_lists:
if sorted(value) != sorted(actual_dictionary[key]):
zoomba.fail("Arrays do not match:" + \
"\nExpected: " + str(sorted(value)) + \
"\nActual: " + str(sorted(actual_dictionary[key])))
continue
else:
zoomba.fail("Arrays do not match:" + \
"\nExpected: " + str(value) + \
"\nActual: " + str(actual_dictionary[key]) + \
"\nIf this is simply out of order try 'sort_list=True'")
continue
else:
if len(actual_dictionary[key]) == 0:
actual_item = ''
Expand Down
2 changes: 1 addition & 1 deletion test/API/test_validate.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ def test_key_by_key_validator_list_not_same_length_fail(self, fail):
def test_key_by_key_validator_list_do_not_match(self, fail):
library = APILibrary()
library.key_by_key_validator({"a": ["1", "2"]}, {"a": ["1", "3"]})
fail.assert_called_with("Arrays do not match:\nExpected: ['1', '3']\nActual: ['1', '2']")
fail.assert_called_with("Arrays do not match:\nExpected: ['1', '3']\nActual: ['1', '2']\nIf this is simply out of order try 'sort_list=True'")

def test_key_by_key_validator_list_sort(self):
library = APILibrary()
Expand Down

0 comments on commit 936226d

Please sign in to comment.