Index: third_party/grpc/src/python/grpcio/tests/interop/_secure_interop_test.py |
diff --git a/third_party/protobuf/src/google/protobuf/arena_nc_test.py b/third_party/grpc/src/python/grpcio/tests/interop/_secure_interop_test.py |
similarity index 57% |
copy from third_party/protobuf/src/google/protobuf/arena_nc_test.py |
copy to third_party/grpc/src/python/grpcio/tests/interop/_secure_interop_test.py |
index 87a69b2afd76e6a81adb30e44d7703280535f600..7e3061133f1119b7cf49f9b0ce46c1f815c21078 100644 |
--- a/third_party/protobuf/src/google/protobuf/arena_nc_test.py |
+++ b/third_party/grpc/src/python/grpcio/tests/interop/_secure_interop_test.py |
@@ -1,8 +1,5 @@ |
-#! /usr/bin/env python |
-# |
-# Protocol Buffers - Google's data interchange format |
-# Copyright 2008 Google Inc. All rights reserved. |
-# https://developers.google.com/protocol-buffers/ |
+# Copyright 2015, Google Inc. |
+# All rights reserved. |
# |
# Redistribution and use in source and binary forms, with or without |
# modification, are permitted provided that the following conditions are |
@@ -30,32 +27,41 @@ |
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
-"""Negative compilation unit tests for arena API.""" |
+"""Secure client-server interoperability as a unit test.""" |
import unittest |
-from google3.testing.pybase import fake_target_util |
-import unittest |
+from grpc.beta import implementations |
+ |
+from tests.interop import _interop_test_case |
+from tests.interop import methods |
+from tests.interop import resources |
+from tests.interop import test_pb2 |
+ |
+from tests.unit.beta import test_utilities |
+ |
+_SERVER_HOST_OVERRIDE = 'foo.test.google.fr' |
-class ArenaNcTest(unittest.TestCase): |
+class SecureInteropTest( |
+ _interop_test_case.InteropTestCase, |
+ unittest.TestCase): |
- def testCompilerErrors(self): |
- """Runs a list of tests to verify compiler error messages.""" |
+ def setUp(self): |
+ self.server = test_pb2.beta_create_TestService_server(methods.TestService()) |
+ port = self.server.add_secure_port( |
+ '[::]:0', implementations.ssl_server_credentials( |
+ [(resources.private_key(), resources.certificate_chain())])) |
+ self.server.start() |
+ self.stub = test_pb2.beta_create_TestService_stub( |
+ test_utilities.not_really_secure_channel( |
+ '[::]', port, implementations.ssl_channel_credentials( |
+ resources.test_root_certificates(), None, None), |
+ _SERVER_HOST_OVERRIDE)) |
- # Defines a list of test specs, where each element is a tuple |
- # (test name, list of regexes for matching the compiler errors). |
- test_specs = [ |
- ('ARENA_PRIVATE_CONSTRUCTOR', |
- [r'calling a protected constructor']), |
- ('SANITY', None)] |
+ def tearDown(self): |
+ self.server.stop(0) |
- fake_target_util.AssertCcCompilerErrors( |
- self, # The current test case. |
- 'google3/google/protobuf/arena_nc', # The fake target file. |
- 'arena_nc.o', # The sub-target to build. |
- test_specs # List of test specifications. |
- ) |
if __name__ == '__main__': |
- unittest.main() |
+ unittest.main(verbosity=2) |