From 4217a79f62cb4b693c1ecbd3ba853c9cebc26ea2 Mon Sep 17 00:00:00 2001 From: Richard Belleville Date: Tue, 22 Oct 2019 21:30:07 -0700 Subject: [PATCH] Add and fix _metadata_flags test --- src/python/grpcio/grpc/_cython/_cygrpc/channel.pyx.pxi | 1 + src/python/grpcio_tests/tests/unit/BUILD.bazel | 1 + src/python/grpcio_tests/tests/unit/_metadata_flags_test.py | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/python/grpcio/grpc/_cython/_cygrpc/channel.pyx.pxi b/src/python/grpcio/grpc/_cython/_cygrpc/channel.pyx.pxi index 16a5a01f6ff..5b39625a02e 100644 --- a/src/python/grpcio/grpc/_cython/_cygrpc/channel.pyx.pxi +++ b/src/python/grpcio/grpc/_cython/_cygrpc/channel.pyx.pxi @@ -260,6 +260,7 @@ cdef void _call( on_success(started_tags) else: raise ValueError('Cannot invoke RPC: %s' % channel_state.closed_reason) + cdef void _process_integrated_call_tag( _ChannelState state, _BatchOperationTag tag) except *: cdef _CallState call_state = state.integrated_call_states.pop(tag) diff --git a/src/python/grpcio_tests/tests/unit/BUILD.bazel b/src/python/grpcio_tests/tests/unit/BUILD.bazel index 587d8cb246f..5fb7c1f74d0 100644 --- a/src/python/grpcio_tests/tests/unit/BUILD.bazel +++ b/src/python/grpcio_tests/tests/unit/BUILD.bazel @@ -23,6 +23,7 @@ GRPCIO_TESTS_UNIT = [ "_invocation_defects_test.py", "_local_credentials_test.py", "_logging_test.py", + "_metadata_flags_test.py", "_metadata_code_details_test.py", "_metadata_test.py", # TODO: Issue 16336 diff --git a/src/python/grpcio_tests/tests/unit/_metadata_flags_test.py b/src/python/grpcio_tests/tests/unit/_metadata_flags_test.py index 7b32b5b5f3e..54fa7c2cfe1 100644 --- a/src/python/grpcio_tests/tests/unit/_metadata_flags_test.py +++ b/src/python/grpcio_tests/tests/unit/_metadata_flags_test.py @@ -183,7 +183,7 @@ class MetadataFlagsTest(unittest.TestCase): fn(channel, wait_for_ready) self.fail("The Call should fail") except BaseException as e: # pylint: disable=broad-except - self.assertIn('StatusCode.UNAVAILABLE', str(e)) + self.assertIs(grpc.StatusCode.UNAVAILABLE, e.code()) def test_call_wait_for_ready_default(self): for perform_call in _ALL_CALL_CASES: