flake8
-
rbtools/testing/api/transport.py (Diff revision 1) Show all issues
Review Request #12260 — Created April 26, 2022 and submitted
Information | |
---|---|
chipx86 | |
RBTools | |
release-3.x | |
Reviewers | |
rbtools | |
URLMapTransport
now supports the?expand=
query string argument,
allowing links to be expanded. When set, the transport will look up any
links listed and try to expand them in the resource before returning it
(and will also attempt to recurse into the expanded resources and expand
links within those).If an expanded URL is not registered, or it's mapped to a HTTP 404
response, then the expansion will be empty (None
or[]
).Normally, a list will be expanded to a list, and a dictionary to a
dictionary. This can be overridden to expand a dictionary into a 1-item
list of dictionaries (needed for review request drafts, due to a design
flaw in the original API). This is done through alink_expansion_types
dictionary that can be set during URL registration.
Made use of this with some in-development unit tests. All tests pass on
all supported versions of Python.Same for all existing tests as of this change.
Fixed to allow dictionary item resources to be expanded as 1-item lists of dictionaries (needed for review request drafts).
Commits: |
|
|||||||||
---|---|---|---|---|---|---|---|---|---|---|
Diff: |
Revision 2 (+458 -30) |
Missing URLs or HTTP 404s are now considered empty expansions, just like with the normal API.
Description: |
|
||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Commits: |
|
||||||||||||||||||||||||||||||||||||||||||||||||
Diff: |
Revision 3 (+510 -30) |
rbtools/testing/api/transport.py (Diff revision 3) |
---|
F507 '...' % ... has 4 placeholder(s) but 3 substitution(s)
Fixed a bad format string.
Commits: |
|
|||||||||
---|---|---|---|---|---|---|---|---|---|---|
Diff: |
Revision 4 (+510 -30) |
rbtools/testing/api/payloads.py (Diff revision 4) |
---|
Can we either make this conditional, or add
assert link_key in payload['links']
above?
Added an assertion to ensure a link name is present in
links
.
Commits: |
|
|||||||||
---|---|---|---|---|---|---|---|---|---|---|
Diff: |
Revision 5 (+512 -30) |