-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Collections: Enhancements, fixes and clanup.
- Enhance recently added `Normalizer` to handle also `ignore_order` and `ignore_keys`. This way they are supported recursively. Fixes #4952. - Various fixes for case-insensitive dictionary comparisons. Most importantly, expected keys and values are now normalized according to possible `keys/values` configuration. Fixes #4343. - Cleanup and refactor code. - Enhance documentation. - Split dictionary related tests to multiple suites. Also cleanup tests releated to comparisons.
- Loading branch information
1 parent
03553b6
commit 6aec6db
Showing
9 changed files
with
820 additions
and
642 deletions.
There are no files selected for viewing
67 changes: 67 additions & 0 deletions
67
atest/robot/standard_libraries/collections/dictionaries_should_be_equal.robot
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
*** Settings *** | ||
Suite Setup Run Tests ${EMPTY} standard_libraries/collections/dictionaries_should_be_equal.robot | ||
Resource atest_resource.robot | ||
|
||
*** Test Cases *** | ||
Comparison with itself | ||
Check Test Case ${TESTNAME} | ||
|
||
Keys in different order | ||
Check Test Case ${TESTNAME} | ||
|
||
Different dictionary types | ||
Check Test Case ${TESTNAME} | ||
|
||
First dictionary missing keys | ||
Check Test Case ${TESTNAME} | ||
|
||
Second dictionary missing keys | ||
Check Test Case ${TESTNAME} | ||
|
||
Both dictionaries missing keys | ||
Check Test Case ${TESTNAME} | ||
|
||
Missing keys and custom error message | ||
Check Test Case ${TESTNAME} | ||
|
||
Missing keys and custom error message with values | ||
Check Test Case ${TESTNAME} | ||
|
||
Different values | ||
Check Test Case ${TESTNAME} | ||
|
||
Different values and custom error message | ||
Check Test Case ${TESTNAME} | ||
|
||
Different values and custom error message with values | ||
Check Test Case ${TESTNAME} | ||
|
||
`ignore_keys` | ||
Check Test Case ${TESTNAME} | ||
|
||
`ignore_keys` with non-string keys | ||
Check Test Case ${TESTNAME} | ||
|
||
`ignore_keys` recursive | ||
Check Test Case ${TESTNAME} | ||
|
||
`ignore_keys` with missing keys | ||
Check Test Case ${TESTNAME} | ||
|
||
`ignore_keys` with wrong values | ||
Check Test Case ${TESTNAME} | ||
|
||
`ignore_keys` as string must be valid expression | ||
Check Test Case ${TESTNAME} | ||
|
||
`ignore_keys` must be list | ||
Check Test Case ${TESTNAME} | ||
|
||
`ignore_case` | ||
Check Test Case ${TESTNAME} | ||
|
||
`ignore_case` with ´ignore_keys` | ||
Check Test Case ${TESTNAME} | ||
|
||
`ignore_case` when normalized keys have conflict | ||
Check Test Case ${TESTNAME} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
97 changes: 97 additions & 0 deletions
97
atest/robot/standard_libraries/collections/dictionary_should_contain.robot
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
*** Settings *** | ||
Suite Setup Run Tests ${EMPTY} standard_libraries/collections/dictionary_should_contain.robot | ||
Resource atest_resource.robot | ||
|
||
*** Test Cases *** | ||
Should contain key | ||
Check Test Case ${TESTNAME} | ||
|
||
Should contain key with custom message | ||
Check Test Case ${TESTNAME} | ||
|
||
Should contain key with `ignore_case` | ||
Check Test Case ${TESTNAME} | ||
|
||
Should not contain key | ||
Check Test Case ${TESTNAME} | ||
|
||
Should not contain key with custom message | ||
Check Test Case ${TESTNAME} | ||
|
||
Should not contain key with `ignore_case` | ||
Check Test Case ${TESTNAME} | ||
|
||
Should contain value | ||
Check Test Case ${TESTNAME} | ||
|
||
Should contain value with custom message | ||
Check Test Case ${TESTNAME} | ||
|
||
Should contain value with `ignore_case` | ||
Check Test Case ${TESTNAME} | ||
|
||
Should not contain value | ||
Check Test Case ${TESTNAME} | ||
|
||
Should not contain value with custom message | ||
Check Test Case ${TESTNAME} | ||
|
||
Should not contain value with `ignore_case` | ||
Check Test Case ${TESTNAME} | ||
|
||
Should contain item | ||
Check Test Case ${TESTNAME} | ||
|
||
Should contain item with missing key | ||
Check Test Case ${TESTNAME} | ||
|
||
Should contain item with missing key and custom message | ||
Check Test Case ${TESTNAME} | ||
|
||
Should contain item with wrong value | ||
Check Test Case ${TESTNAME} | ||
|
||
Should contain item with wrong value and custom message | ||
Check Test Case ${TESTNAME} | ||
|
||
Should contain item with values looking same but having different types | ||
Check Test Case ${TESTNAME} | ||
|
||
Should contain item with `ignore_case` | ||
Check Test Case ${TESTNAME} | ||
|
||
Should contain item with `ignore_case=key` | ||
Check Test Case ${TESTNAME} | ||
|
||
Should contain item with `ignore_case=value` | ||
Check Test Case ${TESTNAME} | ||
|
||
Should contain sub dictionary | ||
Check Test Case ${TESTNAME} | ||
|
||
Should contain sub dictionary with missing keys | ||
Check Test Case ${TESTNAME} | ||
|
||
Should contain sub dictionary with missing keys and custom error message | ||
Check Test Case ${TESTNAME} | ||
|
||
Should contain sub dictionary with missing keys and custom error message containig values | ||
Check Test Case ${TESTNAME} | ||
|
||
Should contain sub dictionary with wrong value | ||
Check Test Case ${TESTNAME} | ||
|
||
Should contain sub dictionary with wrong value and custom error message | ||
Check Test Case ${TESTNAME} | ||
|
||
Should contain sub dictionary with wrong value and custom error message containing values | ||
Check Test Case ${TESTNAME} | ||
|
||
Should contain sub dictionary with `ignore_case` | ||
Check Test Case ${TESTNAME} | ||
|
||
`ignore_case` when normalized keys have conflict | ||
Check Test Case ${TESTNAME} | ||
|
||
`has_key` is not required | ||
Check Test Case ${TESTNAME} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.