From a783eaf37f42702a0752698926f24edea8612922 Mon Sep 17 00:00:00 2001 From: Jisi Liu Date: Mon, 5 Oct 2015 15:06:06 -0700 Subject: make the python json test less strict on expected errors. --- python/google/protobuf/internal/json_format_test.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'python/google') diff --git a/python/google/protobuf/internal/json_format_test.py b/python/google/protobuf/internal/json_format_test.py index 6d0071be..dddc2df8 100644 --- a/python/google/protobuf/internal/json_format_test.py +++ b/python/google/protobuf/internal/json_format_test.py @@ -400,8 +400,8 @@ class JsonFormatTest(JsonFormatBase): def testParseBadIdentifer(self): self.CheckError('{int32Value: 1}', - (r'Failed to load JSON: Expecting property name enclosed ' - r'in double quotes: line 1')) + (r'Failed to load JSON: Expecting property name' + r'( enclosed in double quotes)?: line 1')) self.CheckError('{"unknownName": 1}', 'Message type "proto3.TestMessage" has no field named ' '"unknownName".') @@ -424,7 +424,7 @@ class JsonFormatTest(JsonFormatBase): self.assertRaises(json_format.ParseError, json_format.Parse, text, message) self.CheckError('{"int32Value": 012345}', - (r'Failed to load JSON: Expecting \',\' delimiter: ' + (r'Failed to load JSON: Expecting \'?,\'? delimiter: ' r'line 1')) self.CheckError('{"int32Value": 1.0}', 'Failed to parse int32Value field: ' @@ -462,8 +462,8 @@ class JsonFormatTest(JsonFormatBase): text = '{"int32Map": {1: 2, "2": 3}}' self.assertRaisesRegexp( json_format.ParseError, - (r'Failed to load JSON: Expecting property name enclosed ' - r'in double quotes: line 1'), + (r'Failed to load JSON: Expecting property name' + r'( enclosed in double quotes)?: line 1'), json_format.Parse, text, message) text = r'{"stringMap": {"a": 3, "\u0061": 2}}' self.assertRaisesRegexp( -- cgit v1.2.3