From ce2a2d041dd473408bb3e11c49e39cb689f20495 Mon Sep 17 00:00:00 2001 From: Christian Svensson Date: Thu, 10 Mar 2016 16:50:58 +0100 Subject: ssl_channel_credentials to use None by default Since the default behavior is quite sane, support just calling ssl_channel_credentials() without explicitly specifying ssl_channel_credentials(None, None, None). This changes the pattern ssl_channel_credentials(server_crt, None, None) to ssl_channel_credentials(server_crt) Signed-off-by: Christian Svensson --- src/python/grpcio/tests/unit/beta/_beta_features_test.py | 6 +++--- src/python/grpcio/tests/unit/beta/_face_interface_test.py | 4 ++-- src/python/grpcio/tests/unit/beta/_implementations_test.py | 5 ++--- 3 files changed, 7 insertions(+), 8 deletions(-) (limited to 'src/python/grpcio/tests/unit/beta') diff --git a/src/python/grpcio/tests/unit/beta/_beta_features_test.py b/src/python/grpcio/tests/unit/beta/_beta_features_test.py index ea44177b49..254499884a 100644 --- a/src/python/grpcio/tests/unit/beta/_beta_features_test.py +++ b/src/python/grpcio/tests/unit/beta/_beta_features_test.py @@ -1,4 +1,4 @@ -# Copyright 2015, Google Inc. +# Copyright 2015-2016, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -180,7 +180,7 @@ class BetaFeaturesTest(unittest.TestCase): port = self._server.add_secure_port('[::]:0', server_credentials) self._server.start() self._channel_credentials = implementations.ssl_channel_credentials( - resources.test_root_certificates(), None, None) + resources.test_root_certificates()) self._call_credentials = implementations.metadata_call_credentials( _metadata_plugin) channel = test_utilities.not_really_secure_channel( @@ -293,7 +293,7 @@ class ContextManagementAndLifecycleTest(unittest.TestCase): self._server_credentials = implementations.ssl_server_credentials( [(resources.private_key(), resources.certificate_chain(),),]) self._channel_credentials = implementations.ssl_channel_credentials( - resources.test_root_certificates(), None, None) + resources.test_root_certificates()) self._stub_options = implementations.stub_options( thread_pool_size=test_constants.POOL_SIZE) diff --git a/src/python/grpcio/tests/unit/beta/_face_interface_test.py b/src/python/grpcio/tests/unit/beta/_face_interface_test.py index 1c21dfd03d..b516f59bb2 100644 --- a/src/python/grpcio/tests/unit/beta/_face_interface_test.py +++ b/src/python/grpcio/tests/unit/beta/_face_interface_test.py @@ -1,4 +1,4 @@ -# Copyright 2015, Google Inc. +# Copyright 2015-2016, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -92,7 +92,7 @@ class _Implementation(test_interfaces.Implementation): port = server.add_secure_port('[::]:0', server_credentials) server.start() channel_credentials = implementations.ssl_channel_credentials( - resources.test_root_certificates(), None, None) + resources.test_root_certificates()) channel = test_utilities.not_really_secure_channel( 'localhost', port, channel_credentials, _SERVER_HOST_OVERRIDE) stub_options = implementations.stub_options( diff --git a/src/python/grpcio/tests/unit/beta/_implementations_test.py b/src/python/grpcio/tests/unit/beta/_implementations_test.py index 6b32305af7..26be670c45 100644 --- a/src/python/grpcio/tests/unit/beta/_implementations_test.py +++ b/src/python/grpcio/tests/unit/beta/_implementations_test.py @@ -38,14 +38,13 @@ from tests.unit import resources class ChannelCredentialsTest(unittest.TestCase): def test_runtime_provided_root_certificates(self): - channel_credentials = implementations.ssl_channel_credentials( - None, None, None) + channel_credentials = implementations.ssl_channel_credentials() self.assertIsInstance( channel_credentials, implementations.ChannelCredentials) def test_application_provided_root_certificates(self): channel_credentials = implementations.ssl_channel_credentials( - resources.test_root_certificates(), None, None) + resources.test_root_certificates()) self.assertIsInstance( channel_credentials, implementations.ChannelCredentials) -- cgit v1.2.3