-
Notifications
You must be signed in to change notification settings - Fork 122
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
Bug 1656864: Python: Fix kebab-case to snake_case in loader #1122
Conversation
|
||
|
||
def test_kebab_case_pings(): | ||
pings = load_pings(ROOT / "data" / "pings.yaml") |
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.
I think the pings.yaml
is not yet committed, so you probably want to include it in this commit.
@@ -14,7 +17,9 @@ | |||
|
|||
|
|||
def test_builtin_pings(): | |||
assert set(dir(_builtins.pings)).issuperset(set(["metrics", "baseline", "events"])) | |||
assert set(dir(_builtins.pings)).issuperset( | |||
set(["metrics", "baseline", "events", "deletion_request"]) |
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.
Huh, good to see this fix. Why do we test for superset and not just equality?
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.
Hmm... I'm not sure. Let me just make it equality which will help us catch unexpected changes better in the future.
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.
superset
is needed because the object also contains a bunch of members that exist on every Python object, as well as the reason_code members:
['__class__', '__delattr__', '__dict__', '__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__gt__', '__hash__', '__init__', '__init_subclass__', '__le__', '__lt__', '__module__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '__weakref__', 'baseline', 'baseline_reason_codes', 'deletion_request', 'deletion_request_reason_codes', 'events', 'events_reason_codes', 'metrics', 'metrics_reason_codes']
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.
ugh, in that case it's just a bad test really, as it already missed the deletion_request
part.
Maybe we need to iterate over that, filter by instances of ping and check that against our exact list?
Let's break that out though.
f82b2cc
to
2123292
Compare
2123292
to
92f7032
Compare
No description provided.