aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/python/grpcio/tests/unit/_metadata_test.py
diff options
context:
space:
mode:
authorGravatar Nicolas Noble <nicolasnoble@users.noreply.github.com>2016-06-30 12:22:07 -0700
committerGravatar GitHub <noreply@github.com>2016-06-30 12:22:07 -0700
commita027820b7bea780dba826f680a926ab90253a1f3 (patch)
tree79658186d840ebf4afc203384dcdfee6ad54dd6d /src/python/grpcio/tests/unit/_metadata_test.py
parentae51a39fed1f8bbd275ec6e25a863a5e60b2922c (diff)
parent6a654dd400cc204a1ceb059785821c8ea15acde9 (diff)
Merge pull request #7091 from kpayson64/python_str_stuff
Changed default string type to be str
Diffstat (limited to 'src/python/grpcio/tests/unit/_metadata_test.py')
-rw-r--r--src/python/grpcio/tests/unit/_metadata_test.py24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/python/grpcio/tests/unit/_metadata_test.py b/src/python/grpcio/tests/unit/_metadata_test.py
index 2cb13f236b..c637a28039 100644
--- a/src/python/grpcio/tests/unit/_metadata_test.py
+++ b/src/python/grpcio/tests/unit/_metadata_test.py
@@ -44,33 +44,33 @@ _CHANNEL_ARGS = (('grpc.primary_user_agent', 'primary-agent'),
_REQUEST = b'\x00\x00\x00'
_RESPONSE = b'\x00\x00\x00'
-_UNARY_UNARY = b'/test/UnaryUnary'
-_UNARY_STREAM = b'/test/UnaryStream'
-_STREAM_UNARY = b'/test/StreamUnary'
-_STREAM_STREAM = b'/test/StreamStream'
+_UNARY_UNARY = '/test/UnaryUnary'
+_UNARY_STREAM = '/test/UnaryStream'
+_STREAM_UNARY = '/test/StreamUnary'
+_STREAM_STREAM = '/test/StreamStream'
_USER_AGENT = 'Python-gRPC-{}'.format(_grpcio_metadata.__version__)
_CLIENT_METADATA = (
- (b'client-md-key', b'client-md-key'),
- (b'client-md-key-bin', b'\x00\x01')
+ ('client-md-key', 'client-md-key'),
+ ('client-md-key-bin', b'\x00\x01')
)
_SERVER_INITIAL_METADATA = (
- (b'server-initial-md-key', b'server-initial-md-value'),
- (b'server-initial-md-key-bin', b'\x00\x02')
+ ('server-initial-md-key', 'server-initial-md-value'),
+ ('server-initial-md-key-bin', b'\x00\x02')
)
_SERVER_TRAILING_METADATA = (
- (b'server-trailing-md-key', b'server-trailing-md-value'),
- (b'server-trailing-md-key-bin', b'\x00\x03')
+ ('server-trailing-md-key', 'server-trailing-md-value'),
+ ('server-trailing-md-key-bin', b'\x00\x03')
)
def user_agent(metadata):
for key, val in metadata:
- if key == b'user-agent':
- return val.decode('ascii')
+ if key == 'user-agent':
+ return val
raise KeyError('No user agent!')