summaryrefslogtreecommitdiff
path: root/PRESUBMIT_test.py
diff options
context:
space:
mode:
authorTorne (Richard Coles) <torne@google.com>2014-06-20 14:52:04 +0100
committerTorne (Richard Coles) <torne@google.com>2014-06-20 14:52:04 +0100
commitf8ee788a64d60abd8f2d742a5fdedde054ecd910 (patch)
tree7dc14380200b953c64e0ccd16435cdbd1dbf1205 /PRESUBMIT_test.py
parentfcbbbe23a38088a52492922075e71a419c4b01ec (diff)
downloadchromium_org-f8ee788a64d60abd8f2d742a5fdedde054ecd910.tar.gz
Merge from Chromium at DEPS revision 278205
This commit was generated by merge_to_master.py. Change-Id: I23f1e7ea8c154ba72e7fb594436216f861f868ab
Diffstat (limited to 'PRESUBMIT_test.py')
-rwxr-xr-xPRESUBMIT_test.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/PRESUBMIT_test.py b/PRESUBMIT_test.py
index 5a682a1339..f81b316aa2 100755
--- a/PRESUBMIT_test.py
+++ b/PRESUBMIT_test.py
@@ -470,17 +470,17 @@ class JSONParsingTest(unittest.TestCase):
test_data = [
('invalid_json_1.json',
['{ x }'],
- 'Expecting property name: line 1 column 2 (char 2)'),
+ 'Expecting property name:'),
('invalid_json_2.json',
['// Hello world!',
'{ "hello": "world }'],
- 'Unterminated string starting at: line 2 column 12 (char 12)'),
+ 'Unterminated string starting at:'),
('invalid_json_3.json',
['{ "a": "b", "c": "d", }'],
- 'Expecting property name: line 1 column 22 (char 22)'),
+ 'Expecting property name:'),
('invalid_json_4.json',
['{ "a": "b" "c": "d" }'],
- 'Expecting , delimiter: line 1 column 11 (char 11)'),
+ 'Expecting , delimiter:'),
]
input_api.files = [MockFile(filename, contents)
@@ -488,7 +488,8 @@ class JSONParsingTest(unittest.TestCase):
for (filename, _, expected_error) in test_data:
actual_error = PRESUBMIT._GetJSONParseError(input_api, filename)
- self.assertEqual(expected_error, str(actual_error))
+ self.assertTrue(expected_error in str(actual_error),
+ "'%s' not found in '%s'" % (expected_error, actual_error))
def testNoEatComments(self):
input_api = MockInputApi()