diff options
| author | Donald Sharp <sharpd@cumulusnetworks.com> | 2020-05-23 15:37:10 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-05-23 15:37:10 -0400 |
| commit | 49a3882df107f99be1faa7dbb1f0b75d89c39f1c (patch) | |
| tree | 873a7e6adc627fd0ce261fd1c96351f35834b70b /tests/topotests/lib/topotest.py | |
| parent | cb47b207f520ce9450f7b15fc4818b867cbc0c54 (diff) | |
| parent | b3100f6ce7b17302c03c7c8e411ab5b6c970a875 (diff) | |
Merge pull request #6443 from GalaxyGorilla/json_diff_fix
tests: Fix JSON diff for nested lists
Diffstat (limited to 'tests/topotests/lib/topotest.py')
| -rw-r--r-- | tests/topotests/lib/topotest.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/tests/topotests/lib/topotest.py b/tests/topotests/lib/topotest.py index b0236b01d6..cefb61d198 100644 --- a/tests/topotests/lib/topotest.py +++ b/tests/topotests/lib/topotest.py @@ -173,7 +173,9 @@ def gen_json_diff_report(d1, d2, exact=False, path="> $", acc=(0, "")): closest_diff = None closest_idx = None for idx1, v1 in zip(range(0, len(d1)), d1): - tmp_diff = gen_json_diff_report(v1, v2, path=add_idx(idx1)) + tmp_v1 = deepcopy(v1) + tmp_v2 = deepcopy(v2) + tmp_diff = gen_json_diff_report(tmp_v1, tmp_v2, path=add_idx(idx1)) if not has_errors(tmp_diff): found_match = True del d1[idx1] |
