summaryrefslogtreecommitdiff
path: root/tests/topotests/lib/test/test_json.py
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2020-05-23 15:37:10 -0400
committerGitHub <noreply@github.com>2020-05-23 15:37:10 -0400
commit49a3882df107f99be1faa7dbb1f0b75d89c39f1c (patch)
tree873a7e6adc627fd0ce261fd1c96351f35834b70b /tests/topotests/lib/test/test_json.py
parentcb47b207f520ce9450f7b15fc4818b867cbc0c54 (diff)
parentb3100f6ce7b17302c03c7c8e411ab5b6c970a875 (diff)
Merge pull request #6443 from GalaxyGorilla/json_diff_fix
tests: Fix JSON diff for nested lists
Diffstat (limited to 'tests/topotests/lib/test/test_json.py')
-rwxr-xr-xtests/topotests/lib/test/test_json.py34
1 files changed, 34 insertions, 0 deletions
diff --git a/tests/topotests/lib/test/test_json.py b/tests/topotests/lib/test/test_json.py
index 4b79664018..7a061a9bc6 100755
--- a/tests/topotests/lib/test/test_json.py
+++ b/tests/topotests/lib/test/test_json.py
@@ -463,5 +463,39 @@ def test_json_object_asterisk_matching():
assert json_cmp(dcomplete, dsub4) is None
+def test_json_list_nested_with_objects():
+
+ dcomplete = [
+ {
+ "key": 1,
+ "list": [
+ 123
+ ]
+ },
+ {
+ "key": 2,
+ "list": [
+ 123
+ ]
+ }
+ ]
+
+ dsub1 = [
+ {
+ "key": 2,
+ "list": [
+ 123
+ ]
+ },
+ {
+ "key": 1,
+ "list": [
+ 123
+ ]
+ }
+ ]
+
+ assert json_cmp(dcomplete, dsub1) is None
+
if __name__ == "__main__":
sys.exit(pytest.main())