summaryrefslogtreecommitdiffstats
path: root/python/google/protobuf/internal/message_test.py
diff options
context:
space:
mode:
authorJeff Davidson <jpd@google.com>2015-01-21 22:05:40 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2015-01-21 22:05:40 +0000
commite6ae5ecfc360e1ad261b561c8e5e16b6554d5347 (patch)
tree204041a6b0ac0941d14faa2afe222d1b4b627db9 /python/google/protobuf/internal/message_test.py
parent80aff29bb2d37977a02c0a677721522d3467a4d9 (diff)
parentafb4b72037e3f13db208590fc782c4bc8e27f862 (diff)
downloadexternal_protobuf-e6ae5ecfc360e1ad261b561c8e5e16b6554d5347.zip
external_protobuf-e6ae5ecfc360e1ad261b561c8e5e16b6554d5347.tar.gz
external_protobuf-e6ae5ecfc360e1ad261b561c8e5e16b6554d5347.tar.bz2
Merge "Upgrade protobuf library to v2.6.1."
Diffstat (limited to 'python/google/protobuf/internal/message_test.py')
-rwxr-xr-xpython/google/protobuf/internal/message_test.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/python/google/protobuf/internal/message_test.py b/python/google/protobuf/internal/message_test.py
index f4c4ae0..48b7ffd 100755
--- a/python/google/protobuf/internal/message_test.py
+++ b/python/google/protobuf/internal/message_test.py
@@ -2,7 +2,7 @@
#
# Protocol Buffers - Google's data interchange format
# Copyright 2008 Google Inc. All rights reserved.
-# http://code.google.com/p/protobuf/
+# https://developers.google.com/protocol-buffers/
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
@@ -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.