-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
mutest: new exact_match flag for match and wait step #25
Conversation
a2647eb
to
1a8b4be
Compare
Codecov ReportPatch coverage has no change and project coverage change:
❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more. Additional details and impacted files@@ Coverage Diff @@
## main #25 +/- ##
==========================================
- Coverage 60.17% 60.16% -0.02%
==========================================
Files 17 17
Lines 5153 5154 +1
==========================================
Hits 3101 3101
- Misses 2052 2053 +1 ☔ View full report in Codecov by Sentry. |
1a8b4be
to
f8407da
Compare
f8407da
to
a5ee87e
Compare
json_diff = json.loads(deep_diff.to_json()) | ||
# Remove new fields in json object from diff | ||
if json_diff.get('dictionary_item_added') is not None: | ||
del json_diff['dictionary_item_added'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does json_cmp
always return these key-valus at the top level? i.e., what if you have a diff in a dict in a dict?
json1 = '{ "foo": { "bar": { "one": 1 } } }'
json2 = '{ "foo": { "bar": { "one": 1, "two": 2 } } }'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From my testing, it always appeared that they did. The top-level key value is then associated with an array of paths locating any differences of the specified key value type.
For example, json_diff(json.loads(json1), json.loads(json2))
returns the DeepDiff object which, when converted to a dict
or list
at all levels, is equivalent to {'dictionary_item_added':["root['foo']['bar']['two']"]}
Similarly, json_diff(json.loads(json2), json.loads(json1))
returns the DeepDiff object which, when converted to a dict
or list
at all levels, is equivalent to {'dictionary_item_removed':["root['foo']['bar']['two']"]}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok thanks
also fixed some minor inaccuracies in type annotations and docstrings Signed-off-by: lbrady <[email protected]>
Signed-off-by: lbrady <[email protected]>
Signed-off-by: lbrady <[email protected]>
a5ee87e
to
5019935
Compare
Adds in new exact_match flag for (in)exact matching. This results in the following states:
For the match and wait steps (non-json):
For the match_json and wait_json steps:
And the new default behavior of munet is for exact matching to be set to false.