diff options
author | 2016-07-08 12:12:49 -0700 | |
---|---|---|
committer | 2016-07-08 12:12:49 -0700 | |
commit | 4e19d66514549b56804189e98407657545036f72 (patch) | |
tree | ac174321878fd8dcb7e7edb68881ef6536f0e3d6 /src/python/grpcio_tests/tests/unit | |
parent | f5d5ad823d02a64b3aa6606652e869de21ea4c09 (diff) | |
parent | 45c0f2b3051bf1642337e109df57e8031cb654c8 (diff) |
Merge pull request #7260 from kpayson64/ga_performance_tests
Migrated python performance tests to use GA API
Diffstat (limited to 'src/python/grpcio_tests/tests/unit')
-rw-r--r-- | src/python/grpcio_tests/tests/unit/test_common.py | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/python/grpcio_tests/tests/unit/test_common.py b/src/python/grpcio_tests/tests/unit/test_common.py index c8886bf4ca..cd71bd80d7 100644 --- a/src/python/grpcio_tests/tests/unit/test_common.py +++ b/src/python/grpcio_tests/tests/unit/test_common.py @@ -31,6 +31,7 @@ import collections +import grpc import six INVOCATION_INITIAL_METADATA = (('0', 'abc'), ('1', 'def'), ('2', 'ghi'),) @@ -78,3 +79,24 @@ def metadata_transmitted(original_metadata, transmitted_metadata): return False else: return True + + +def test_secure_channel( + target, channel_credentials, server_host_override): + """Creates an insecure Channel to a remote host. + + Args: + host: The name of the remote host to which to connect. + port: The port of the remote host to which to connect. + channel_credentials: The implementations.ChannelCredentials with which to + connect. + server_host_override: The target name used for SSL host name checking. + + Returns: + An implementations.Channel to the remote host through which RPCs may be + conducted. + """ + channel = grpc.secure_channel( + target, channel_credentials, + (('grpc.ssl_target_name_override', server_host_override,),)) + return channel |