mirror of
https://github.com/python/cpython.git
synced 2025-11-27 13:45:25 +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:
commit
dbcae3c191
3 changed files with 15 additions and 0 deletions
|
|
@ -54,6 +54,15 @@ class TestDecode:
|
||||||
self.check_keys_reuse(s, self.loads)
|
self.check_keys_reuse(s, self.loads)
|
||||||
self.check_keys_reuse(s, self.json.decoder.JSONDecoder().decode)
|
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 TestPyDecode(TestDecode, PyTest): pass
|
||||||
class TestCDecode(TestDecode, CTest): pass
|
class TestCDecode(TestDecode, CTest): pass
|
||||||
|
|
|
||||||
|
|
@ -238,6 +238,7 @@ Evan Dandrea
|
||||||
Eric Daniel
|
Eric Daniel
|
||||||
Scott David Daniels
|
Scott David Daniels
|
||||||
Ben Darnell
|
Ben Darnell
|
||||||
|
Kushal Das
|
||||||
Jonathan Dasteel
|
Jonathan Dasteel
|
||||||
Pierre-Yves David
|
Pierre-Yves David
|
||||||
Xavier de Gaye
|
Xavier de Gaye
|
||||||
|
|
|
||||||
|
|
@ -52,6 +52,11 @@ Documentation
|
||||||
- Issue #15630: Add an example for "continue" stmt in the tutorial. Patch by
|
- Issue #15630: Add an example for "continue" stmt in the tutorial. Patch by
|
||||||
Daniel Ellis.
|
Daniel Ellis.
|
||||||
|
|
||||||
|
Tests
|
||||||
|
-----
|
||||||
|
|
||||||
|
- Issue #15615: Add some tests for the json module's handling of invalid
|
||||||
|
input data. Patch by Kushal Das.
|
||||||
|
|
||||||
|
|
||||||
What's New in Python 3.3.0 Beta 2?
|
What's New in Python 3.3.0 Beta 2?
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue