aboutsummaryrefslogtreecommitdiffhomepage
path: root/python/google/protobuf/internal
diff options
context:
space:
mode:
authorGravatar Jisi Liu <jisi.liu@gmail.com>2015-10-05 15:06:06 -0700
committerGravatar Jisi Liu <jisi.liu@gmail.com>2015-10-05 15:06:06 -0700
commita783eaf37f42702a0752698926f24edea8612922 (patch)
tree150583e50d4f025a08c8ad6a3ffc4198177943e1 /python/google/protobuf/internal
parent61871a02d4d2f063989f2fd8f238cdc0db4afb2a (diff)
make the python json test less strict on expected errors.
Diffstat (limited to 'python/google/protobuf/internal')
-rw-r--r--python/google/protobuf/internal/json_format_test.py10
1 files changed, 5 insertions, 5 deletions
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(