diff options
author | Feng Xiao <xfxyjwf@gmail.com> | 2014-10-07 17:44:33 -0700 |
---|---|---|
committer | Feng Xiao <xfxyjwf@gmail.com> | 2014-10-07 17:44:48 -0700 |
commit | 0971bb0d57aa6f2db1abee4008b365d52b402891 (patch) | |
tree | c7408b9bd878da51d232da03f9d5c1b2e5be32b9 /python/google/protobuf/internal/message_test.py | |
parent | c1d16457dbf5f1b0770db406b75b4b2063556cc3 (diff) |
Down-integrate from internal branch.
Diffstat (limited to 'python/google/protobuf/internal/message_test.py')
-rwxr-xr-x | python/google/protobuf/internal/message_test.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/python/google/protobuf/internal/message_test.py b/python/google/protobuf/internal/message_test.py index 3cce3383..48b7ffd4 100755 --- a/python/google/protobuf/internal/message_test.py +++ b/python/google/protobuf/internal/message_test.py @@ -634,7 +634,12 @@ class MessageTest(basetest.TestCase): self.assertTrue(m.HasField('oneof_uint32')) self.assertEqual('oneof_uint32', m.WhichOneof('oneof_field')) - + def testOneofDeserialize(self): + m = unittest_pb2.TestAllTypes() + m.oneof_uint32 = 11 + m2 = unittest_pb2.TestAllTypes() + m2.ParseFromString(m.SerializeToString()) + self.assertEqual('oneof_uint32', m2.WhichOneof('oneof_field')) def testSortEmptyRepeatedCompositeContainer(self): """Exercise a scenario that has led to segfaults in the past. |