aboutsummaryrefslogtreecommitdiffhomepage
path: root/python/google/protobuf/internal/text_format_test.py
diff options
context:
space:
mode:
Diffstat (limited to 'python/google/protobuf/internal/text_format_test.py')
-rwxr-xr-xpython/google/protobuf/internal/text_format_test.py30
1 files changed, 14 insertions, 16 deletions
diff --git a/python/google/protobuf/internal/text_format_test.py b/python/google/protobuf/internal/text_format_test.py
index ab481ab4..176cbd15 100755
--- a/python/google/protobuf/internal/text_format_test.py
+++ b/python/google/protobuf/internal/text_format_test.py
@@ -582,22 +582,20 @@ class OnlyWorksWithProto2RightNowTests(TextFormatBase):
% (letter,) for letter in string.ascii_uppercase))
self.CompareToGoldenText(text_format.MessageToString(message), golden)
- def testMapOrderSemantics(self):
- golden_lines = self.ReadGolden('map_test_data.txt')
- # The C++ implementation emits defaulted-value fields, while the Python
- # implementation does not. Adjusting for this is awkward, but it is
- # valuable to test against a common golden file.
- line_blacklist = (' key: 0\n', ' value: 0\n', ' key: false\n',
- ' value: false\n')
- golden_lines = [line for line in golden_lines if line not in line_blacklist]
-
- message = map_unittest_pb2.TestMap()
- text_format.ParseLines(golden_lines, message)
- candidate = text_format.MessageToString(message)
- # The Python implementation emits "1.0" for the double value that the C++
- # implementation emits as "1".
- candidate = candidate.replace('1.0', '1', 2)
- self.assertMultiLineEqual(candidate, ''.join(golden_lines))
+ # TODO(teboring): In c/137553523, not serializing default value for map entry
+ # message has been fixed. This test needs to be disabled in order to submit
+ # that cl. Add this back when c/137553523 has been submitted.
+ # def testMapOrderSemantics(self):
+ # golden_lines = self.ReadGolden('map_test_data.txt')
+
+ # message = map_unittest_pb2.TestMap()
+ # text_format.ParseLines(golden_lines, message)
+ # candidate = text_format.MessageToString(message)
+ # # The Python implementation emits "1.0" for the double value that the C++
+ # # implementation emits as "1".
+ # candidate = candidate.replace('1.0', '1', 2)
+ # candidate = candidate.replace('0.0', '0', 2)
+ # self.assertMultiLineEqual(candidate, ''.join(golden_lines))
# Tests of proto2-only features (MessageSet, extensions, etc.).