Skip to content
Snippets Groups Projects
Commit 6a26b3ff authored by Marco Clemencic's avatar Marco Clemencic
Browse files

Fixed JSON validation, which was not taking order into account

See merge request gaudi/Gaudi!1496
parents 7c341946 a107e474
No related branches found
No related tags found
1 merge request!1496Fixed JSON validation, which was not taking order into account
Pipeline #6366556 passed
......@@ -1511,6 +1511,11 @@ class JSONOutputValidator:
# piggyback on TestCase dict diff report
t = TestCase()
# sort both lists (these are list of entities) as the order is not supposed to matter
# indeed, the JSONSink implementation does not garantee any particular order
# but as JSON does not have sets, we get back a sorted list here
expected = sorted(expected, key=lambda item: (item["component"], item["name"]))
out = sorted(out, key=lambda item: (item["component"], item["name"]))
try:
t.assertEqual(expected, out)
except AssertionError as err:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment