Skip to content

Commit

Permalink
Merge 6240679 into 865459f
Browse files Browse the repository at this point in the history
  • Loading branch information
Wolfe1 committed Dec 4, 2020
2 parents 865459f + 6240679 commit 06ffeb6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Zoomba/APILibrary.py
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,10 @@ def _key_by_key_list(self, key, value, actual_dictionary, unmatched_keys_list=No
"\nActual: " + str(actual_dictionary[key]))
continue
else:
actual_item = actual_dictionary[key][index]
if len(actual_dictionary[key]) == 0:
actual_item = ''
else:
actual_item = actual_dictionary[key][index]
temp_actual_dict = {key: actual_item}
temp_expected_dict = {key: item}
if unmatched_keys_list:
Expand Down
6 changes: 6 additions & 0 deletions test/API/test_validate.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,12 @@ def test_key_by_key_validator_list_int(self):
library = APILibrary()
library.key_by_key_validator({"a": [1]}, {"a": [1]})

def test_key_by_key_validator_list_empty_fail(self):
library = APILibrary()
unmatched = []
library.key_by_key_validator({"a": []}, {"a": [1]}, unmatched_keys_list=unmatched)
assert unmatched == [('------------------\nKey: a[0]', 'Expected: 1', 'Actual: ')]

def test_key_by_key_validator_simple_ignored_key(self):
library = APILibrary()
library.key_by_key_validator({"a": ["1"]}, {"a": ["1"]}, ["a"])
Expand Down

0 comments on commit 06ffeb6

Please sign in to comment.