Uh oh!
There was an error while loading. Please reload this page.
test: improve routing parameter assert - #2131
Conversation
a5f2c67 to
42f4a17Compare42f4a17 to
0586c9aCompare0586c9a to
d9664afCompare
vchudnov-g
left a comment
There was a problem hiding this comment.
Looks good, but I have some questions to make sure I understand the (pre-existing) structure of the code touched here.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Co-authored-by: Victor Chudnovsky <vchudnov@google.com>
| def resolve(cls, routing_rule: routing_pb2.RoutingRule, request: Union[dict, str]) -> dict: | ||
| """Resolves the routing header which should be sent along with the request. | ||
| This function performs dynamic header resolution, identical to what's in `_client_macros.j2`. | ||
| https://github.com/googleapis/gapic-generator-python/blob/4c5de8791795f8101f6ec66f80b8a8e5e9a21822/gapic/templates/%25namespace/%25name_%25version/%25sub/services/%25service/_client_macros.j2#L150-L164 |
There was a problem hiding this comment.
nit: Consider using a TinyURL or similar, and enclosing the URL in <> so that it's rendered clickable by some tools.
There was a problem hiding this comment.
Superseded by review comment #2131 (comment)
| @classmethod | ||
| def resolve(cls, routing_rule: routing_pb2.RoutingRule, request: Union[dict, str]) -> dict: | ||
| """Resolves the routing header which should be sent along with the request. | ||
| This function performs dynamic header resolution, identical to what's in `_client_macros.j2`. |
There was a problem hiding this comment.
nit: I would add a TODO referencing #2160 about refactoring the common code and then removing this sentence.
Uh oh!
There was an error while loading. Please reload this page.
This PR fixes the assert in
test_*_routing_parametersto verify the routing headers inkw['metadata'].The
resolvefunction intests/unit/schema/wrappers/test_routing.pywas moved togapic/schema/wrappers.pyso that it can be used ingapic/templates/tests/unit/gapic/%name_%version/%sub/test_macros.j2Towards #2091