-Make message __deepcopy__ call UPB code instead of default implementation for python UPB (splitted change 1)

PiperOrigin-RevId: 528083849
pull/10781/head
Jie Luo 2 years ago committed by Copybara-Service
parent 0f61acdf98
commit 65e047d098
  1. 12
      python/google/protobuf/internal/message_test.py

@ -1409,7 +1409,11 @@ class Proto2Test(unittest.TestCase):
self.assertEqual(all_set, golden_message)
self.assertEqual(golden_data, golden_message.SerializeToString())
golden_copy = copy.deepcopy(golden_message)
self.assertEqual(golden_data, golden_copy.SerializeToString())
self.assertEqual(golden_message, golden_copy)
# Depend on a specific serialization order for extensions is not
# reasonable to guarantee.
if api_implementation.Type() != 'upb':
self.assertEqual(golden_data, golden_copy.SerializeToString())
def testGoldenPackedExtensions(self):
golden_data = test_util.GoldenFileData('golden_packed_fields_message')
@ -1420,7 +1424,11 @@ class Proto2Test(unittest.TestCase):
self.assertEqual(all_set, golden_message)
self.assertEqual(golden_data, all_set.SerializeToString())
golden_copy = copy.deepcopy(golden_message)
self.assertEqual(golden_data, golden_copy.SerializeToString())
self.assertEqual(golden_message, golden_copy)
# Depend on a specific serialization order for extensions is not
# reasonable to guarantee.
if api_implementation.Type() != 'upb':
self.assertEqual(golden_data, golden_copy.SerializeToString())
def testPickleIncompleteProto(self):
golden_message = unittest_pb2.TestRequired(a=1)

Loading…
Cancel
Save