aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/python/grpcio_tests/tests
diff options
context:
space:
mode:
authorGravatar Lidi Zheng <scallopsky@gmail.com>2018-10-15 09:58:08 -0700
committerGravatar GitHub <noreply@github.com>2018-10-15 09:58:08 -0700
commit08588f7077068933fa6aab6e67700f04d2576b75 (patch)
treeef3bb1bcf9b182311e6a51c1ffe0b61ac51c1041 /src/python/grpcio_tests/tests
parent8abeb9f659255a6e3ef8d25d174e8071648c3421 (diff)
parent118e134ded9dba1b509852d0986b9e3427eb498f (diff)
Merge pull request #16864 from lidizheng/master
Fix Exception throw for invalid channel args
Diffstat (limited to 'src/python/grpcio_tests/tests')
-rw-r--r--src/python/grpcio_tests/tests/unit/_channel_args_test.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/python/grpcio_tests/tests/unit/_channel_args_test.py b/src/python/grpcio_tests/tests/unit/_channel_args_test.py
index 869c2f4d2f..dd1d2969a2 100644
--- a/src/python/grpcio_tests/tests/unit/_channel_args_test.py
+++ b/src/python/grpcio_tests/tests/unit/_channel_args_test.py
@@ -33,6 +33,14 @@ TEST_CHANNEL_ARGS = (
('arg6', TestPointerWrapper()),
)
+INVALID_TEST_CHANNEL_ARGS = [
+ {
+ 'foo': 'bar'
+ },
+ (('key',),),
+ 'str',
+]
+
class ChannelArgsTest(unittest.TestCase):
@@ -44,6 +52,14 @@ class ChannelArgsTest(unittest.TestCase):
futures.ThreadPoolExecutor(max_workers=1),
options=TEST_CHANNEL_ARGS)
+ def test_invalid_client_args(self):
+ for invalid_arg in INVALID_TEST_CHANNEL_ARGS:
+ self.assertRaises(
+ ValueError,
+ grpc.insecure_channel,
+ 'localhost:8080',
+ options=invalid_arg)
+
if __name__ == '__main__':
unittest.main(verbosity=2)