-
Notifications
You must be signed in to change notification settings - Fork 69
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
tests: add showcase tests for reading grpc/rest response metadata #2300
base: main
Are you sure you want to change the base?
Conversation
4d0f596
to
a48fc54
Compare
self.request_metadata = [] | ||
self.response_metadata = [] | ||
|
||
async def _add_metadata(self, client_call_details): |
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.
async def _add_metadata(self, client_call_details): | |
async def _add_request_metadata(self, client_call_details): |
response_it = continuation(client_call_details, request) | ||
return response_it | ||
|
||
async def intercept_stream_unary( |
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.
We should use more descriptive names to differentiate this method from the previous one. I realize previously existing classes established this pattern, but we should clarify.
return response_it | ||
|
||
|
||
class MetadataClienRestInterceptor(EchoRestInterceptor): |
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 would clarify in the name that this is for the echo service
class MetadataClienRestInterceptor(EchoRestInterceptor): | |
class EchoMetadataClienRestInterceptor(EchoRestInterceptor): |
|
||
|
||
@pytest.fixture | ||
def intercepted_echo_grpc_async(): |
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.
Put the two grpc fixtures next to each other?
|
||
|
||
@pytest.fixture | ||
def intercepted_echo_rest(): |
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.
We're waiting for REST async or can we test that now?
@@ -21,9 +21,10 @@ | |||
intercepted_metadata = (('showcase-trailer', 'intercepted'),) | |||
|
|||
|
|||
def test_unary_stream(intercepted_echo): | |||
def test_unary_stream(intercepted_echo_grpc): |
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.
Do we want to test async grpc here?
|
||
|
||
@pytest.mark.parametrize( | ||
"transport,response_metadata", |
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.
How do the interceptors used int his file know about the response metadata they should be injecting? Or is this real response metadata from Showcase? I'm not finding it by doing a search n the Showcase repo.
This PR is built on top of #2299 and adds showcase test for grpc/rest response metadata