|
@@ -39,10 +39,10 @@ import copy
|
|
|
import gc
|
|
|
import operator
|
|
|
import struct
|
|
|
+import unittest
|
|
|
|
|
|
import six
|
|
|
|
|
|
-from google.apputils import basetest
|
|
|
from google.protobuf import unittest_import_pb2
|
|
|
from google.protobuf import unittest_mset_pb2
|
|
|
from google.protobuf import unittest_pb2
|
|
@@ -104,7 +104,7 @@ class _MiniDecoder(object):
|
|
|
return self._pos == len(self._bytes)
|
|
|
|
|
|
|
|
|
-class ReflectionTest(basetest.TestCase):
|
|
|
+class ReflectionTest(unittest.TestCase):
|
|
|
|
|
|
def assertListsEqual(self, values, others):
|
|
|
self.assertEqual(len(values), len(others))
|
|
@@ -1623,7 +1623,7 @@ class ReflectionTest(basetest.TestCase):
|
|
|
self.assertFalse(proto.IsInitialized(errors))
|
|
|
self.assertEqual(errors, ['a', 'b', 'c'])
|
|
|
|
|
|
- @basetest.unittest.skipIf(
|
|
|
+ @unittest.skipIf(
|
|
|
api_implementation.Type() != 'cpp' or api_implementation.Version() != 2,
|
|
|
'Errors are only available from the most recent C++ implementation.')
|
|
|
def testFileDescriptorErrors(self):
|
|
@@ -1801,7 +1801,7 @@ class ReflectionTest(basetest.TestCase):
|
|
|
# into separate TestCase classes.
|
|
|
|
|
|
|
|
|
-class TestAllTypesEqualityTest(basetest.TestCase):
|
|
|
+class TestAllTypesEqualityTest(unittest.TestCase):
|
|
|
|
|
|
def setUp(self):
|
|
|
self.first_proto = unittest_pb2.TestAllTypes()
|
|
@@ -1817,7 +1817,7 @@ class TestAllTypesEqualityTest(basetest.TestCase):
|
|
|
self.assertEqual(self.first_proto, self.second_proto)
|
|
|
|
|
|
|
|
|
-class FullProtosEqualityTest(basetest.TestCase):
|
|
|
+class FullProtosEqualityTest(unittest.TestCase):
|
|
|
|
|
|
"""Equality tests using completely-full protos as a starting point."""
|
|
|
|
|
@@ -1903,7 +1903,7 @@ class FullProtosEqualityTest(basetest.TestCase):
|
|
|
self.assertEqual(self.first_proto, self.second_proto)
|
|
|
|
|
|
|
|
|
-class ExtensionEqualityTest(basetest.TestCase):
|
|
|
+class ExtensionEqualityTest(unittest.TestCase):
|
|
|
|
|
|
def testExtensionEquality(self):
|
|
|
first_proto = unittest_pb2.TestAllExtensions()
|
|
@@ -1936,7 +1936,7 @@ class ExtensionEqualityTest(basetest.TestCase):
|
|
|
self.assertEqual(first_proto, second_proto)
|
|
|
|
|
|
|
|
|
-class MutualRecursionEqualityTest(basetest.TestCase):
|
|
|
+class MutualRecursionEqualityTest(unittest.TestCase):
|
|
|
|
|
|
def testEqualityWithMutualRecursion(self):
|
|
|
first_proto = unittest_pb2.TestMutualRecursionA()
|
|
@@ -1948,7 +1948,7 @@ class MutualRecursionEqualityTest(basetest.TestCase):
|
|
|
self.assertEqual(first_proto, second_proto)
|
|
|
|
|
|
|
|
|
-class ByteSizeTest(basetest.TestCase):
|
|
|
+class ByteSizeTest(unittest.TestCase):
|
|
|
|
|
|
def setUp(self):
|
|
|
self.proto = unittest_pb2.TestAllTypes()
|
|
@@ -2244,7 +2244,7 @@ class ByteSizeTest(basetest.TestCase):
|
|
|
# * Handling of empty submessages (with and without "has"
|
|
|
# bits set).
|
|
|
|
|
|
-class SerializationTest(basetest.TestCase):
|
|
|
+class SerializationTest(unittest.TestCase):
|
|
|
|
|
|
def testSerializeEmtpyMessage(self):
|
|
|
first_proto = unittest_pb2.TestAllTypes()
|
|
@@ -2795,7 +2795,7 @@ class SerializationTest(basetest.TestCase):
|
|
|
self.assertEqual(3, proto.repeated_int32[2])
|
|
|
|
|
|
|
|
|
-class OptionsTest(basetest.TestCase):
|
|
|
+class OptionsTest(unittest.TestCase):
|
|
|
|
|
|
def testMessageOptions(self):
|
|
|
proto = unittest_mset_pb2.TestMessageSet()
|
|
@@ -2822,9 +2822,9 @@ class OptionsTest(basetest.TestCase):
|
|
|
|
|
|
|
|
|
|
|
|
-class ClassAPITest(basetest.TestCase):
|
|
|
+class ClassAPITest(unittest.TestCase):
|
|
|
|
|
|
- @basetest.unittest.skipIf(
|
|
|
+ @unittest.skipIf(
|
|
|
api_implementation.Type() == 'cpp' and api_implementation.Version() == 2,
|
|
|
'C++ implementation requires a call to MakeDescriptor()')
|
|
|
def testMakeClassWithNestedDescriptor(self):
|
|
@@ -2955,4 +2955,4 @@ class ClassAPITest(basetest.TestCase):
|
|
|
self.assertEqual(msg.bar.baz.deep, 4)
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
- basetest.main()
|
|
|
+ unittest.main()
|