Issue #15615: Add some tests for the json module's handling of invalid input data.
Patch by Kushal Das.
This commit is contained in:
parent
2de4be2efd
commit
0e3a4c8058
|
@ -45,6 +45,15 @@ class TestDecode(object):
|
|||
object_hook=lambda x: None),
|
||||
OrderedDict(p))
|
||||
|
||||
def test_extra_data(self):
|
||||
s = '[1, 2, 3]5'
|
||||
msg = 'Extra data'
|
||||
self.assertRaisesRegexp(ValueError, msg, self.loads, s)
|
||||
|
||||
def test_invalid_escape(self):
|
||||
s = '["abc\\y"]'
|
||||
msg = 'escape'
|
||||
self.assertRaisesRegexp(ValueError, msg, self.loads, s)
|
||||
|
||||
class TestPyDecode(TestDecode, PyTest): pass
|
||||
class TestCDecode(TestDecode, CTest): pass
|
||||
|
|
|
@ -194,6 +194,7 @@ Evan Dandrea
|
|||
Eric Daniel
|
||||
Scott David Daniels
|
||||
Ben Darnell
|
||||
Kushal Das
|
||||
Jonathan Dasteel
|
||||
John DeGood
|
||||
Ned Deily
|
||||
|
|
Loading…
Reference in New Issue