diff options
author | Ken Payson <kpayson@google.com> | 2016-07-06 19:26:09 -0700 |
---|---|---|
committer | Ken Payson <kpayson@google.com> | 2016-07-06 19:26:09 -0700 |
commit | 45c0f2b3051bf1642337e109df57e8031cb654c8 (patch) | |
tree | 6df1970ad7f8c715c06bce4ba554fbb6dec0e078 /src/python/grpcio_tests/tests/unit/test_common.py | |
parent | dcca468abe87f76bcb8fd85973781612742da9df (diff) |
Migrated python performance tests to use GA API
Diffstat (limited to 'src/python/grpcio_tests/tests/unit/test_common.py')
-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 |