aboutsummaryrefslogtreecommitdiff
path: root/python/google/protobuf/internal/text_format_test.py
diff options
context:
space:
mode:
authorFeng Xiao <xfxyjwf@gmail.com>2014-10-07 17:44:33 -0700
committerFeng Xiao <xfxyjwf@gmail.com>2014-10-07 17:44:48 -0700
commit0971bb0d57aa6f2db1abee4008b365d52b402891 (patch)
treec7408b9bd878da51d232da03f9d5c1b2e5be32b9 /python/google/protobuf/internal/text_format_test.py
parentc1d16457dbf5f1b0770db406b75b4b2063556cc3 (diff)
downloadprotobuf-0971bb0d57aa6f2db1abee4008b365d52b402891.tar.gz
protobuf-0971bb0d57aa6f2db1abee4008b365d52b402891.tar.bz2
protobuf-0971bb0d57aa6f2db1abee4008b365d52b402891.zip
Down-integrate from internal branch.
Diffstat (limited to 'python/google/protobuf/internal/text_format_test.py')
-rwxr-xr-xpython/google/protobuf/internal/text_format_test.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/python/google/protobuf/internal/text_format_test.py b/python/google/protobuf/internal/text_format_test.py
index b30ea19f..b0a3a5f7 100755
--- a/python/google/protobuf/internal/text_format_test.py
+++ b/python/google/protobuf/internal/text_format_test.py
@@ -587,6 +587,13 @@ class TextFormatTest(basetest.TestCase):
test_util.SetAllFields(message)
self.assertEqual(message, parsed_message)
+ def testParseOneof(self):
+ m = unittest_pb2.TestAllTypes()
+ m.oneof_uint32 = 11
+ m2 = unittest_pb2.TestAllTypes()
+ text_format.Parse(text_format.MessageToString(m), m2)
+ self.assertEqual('oneof_uint32', m2.WhichOneof('oneof_field'))
+
class TokenizerTest(basetest.TestCase):