mirror of
https://github.com/python/cpython.git
synced 2026-01-06 15:32:22 +00:00
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
05d79e9abf
commit
b47ea9a6fe
3 changed files with 13 additions and 0 deletions
|
|
@ -54,6 +54,15 @@ def test_keys_reuse(self):
|
|||
self.check_keys_reuse(s, self.loads)
|
||||
self.check_keys_reuse(s, self.json.decoder.JSONDecoder().decode)
|
||||
|
||||
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
|
||||
|
|
|
|||
|
|
@ -218,6 +218,7 @@ Evan Dandrea
|
|||
Eric Daniel
|
||||
Scott David Daniels
|
||||
Ben Darnell
|
||||
Kushal Das
|
||||
Jonathan Dasteel
|
||||
John DeGood
|
||||
Ned Deily
|
||||
|
|
|
|||
|
|
@ -425,6 +425,9 @@ Extension Modules
|
|||
Tests
|
||||
-----
|
||||
|
||||
- Issue #15615: Add some tests for the json module's handling of invalid
|
||||
input data. Patch by Kushal Das.
|
||||
|
||||
- Issue #15496: Add directory removal helpers for tests on Windows.
|
||||
Patch by Jeremy Kloth.
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue