diff options
author | Nathaniel Manista <nathaniel@google.com> | 2016-12-19 18:08:32 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-12-19 18:08:32 -0800 |
commit | ab8fb5be323cb99c2071c04b4585c8a4d066a38d (patch) | |
tree | 88a0fc1d1f4cffdf4383a2561012794a7501c16b /src/python/grpcio_tests | |
parent | 7d30bb202d2eda4c0b626c3bb191d8b8233c5c23 (diff) | |
parent | 6aedd44fb69ac8015a4e48071582a9d74fa57f00 (diff) |
Merge pull request #9156 from nathanielmanistaatgoogle/Exception.message
Drop use of Exception.message in metadata test.
Diffstat (limited to 'src/python/grpcio_tests')
-rw-r--r-- | src/python/grpcio_tests/tests/unit/_invalid_metadata_test.py | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/src/python/grpcio_tests/tests/unit/_invalid_metadata_test.py b/src/python/grpcio_tests/tests/unit/_invalid_metadata_test.py index 0411c58900..2dc225de29 100644 --- a/src/python/grpcio_tests/tests/unit/_invalid_metadata_test.py +++ b/src/python/grpcio_tests/tests/unit/_invalid_metadata_test.py @@ -83,8 +83,7 @@ class InvalidMetadataTest(unittest.TestCase): expected_error_details = "metadata was invalid: %s" % metadata with self.assertRaises(ValueError) as exception_context: self._unary_unary(request, metadata=metadata) - self.assertEqual( - expected_error_details, exception_context.exception.message) + self.assertIn(expected_error_details, str(exception_context.exception)) def testUnaryRequestBlockingUnaryResponseWithCall(self): request = b'\x07\x08' @@ -92,8 +91,7 @@ class InvalidMetadataTest(unittest.TestCase): expected_error_details = "metadata was invalid: %s" % metadata with self.assertRaises(ValueError) as exception_context: self._unary_unary.with_call(request, metadata=metadata) - self.assertEqual( - expected_error_details, exception_context.exception.message) + self.assertIn(expected_error_details, str(exception_context.exception)) def testUnaryRequestFutureUnaryResponse(self): request = b'\x07\x08' @@ -129,8 +127,7 @@ class InvalidMetadataTest(unittest.TestCase): expected_error_details = "metadata was invalid: %s" % metadata with self.assertRaises(ValueError) as exception_context: self._stream_unary(request_iterator, metadata=metadata) - self.assertEqual( - expected_error_details, exception_context.exception.message) + self.assertIn(expected_error_details, str(exception_context.exception)) def testStreamRequestBlockingUnaryResponseWithCall(self): request_iterator = ( @@ -140,8 +137,7 @@ class InvalidMetadataTest(unittest.TestCase): multi_callable = _stream_unary_multi_callable(self._channel) with self.assertRaises(ValueError) as exception_context: multi_callable.with_call(request_iterator, metadata=metadata) - self.assertEqual( - expected_error_details, exception_context.exception.message) + self.assertIn(expected_error_details, str(exception_context.exception)) def testStreamRequestFutureUnaryResponse(self): request_iterator = ( |