summaryrefslogtreecommitdiffstats
path: root/Lib/json/tests
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2008-10-16 21:17:24 (GMT)
committerBenjamin Peterson <benjamin@python.org>2008-10-16 21:17:24 (GMT)
commita13d475901553b4a0ec7ed679ce2eac4598b557f (patch)
treedc0745a76b64e954cded961b6ec99bc08bdeac78 /Lib/json/tests
parent60192084c405292f874d886eed05ed83614d20c4 (diff)
downloadcpython-a13d475901553b4a0ec7ed679ce2eac4598b557f.zip
cpython-a13d475901553b4a0ec7ed679ce2eac4598b557f.tar.gz
cpython-a13d475901553b4a0ec7ed679ce2eac4598b557f.tar.bz2
merge r66932 and add a few py3k only checks
Diffstat (limited to 'Lib/json/tests')
-rw-r--r--Lib/json/tests/test_scanstring.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/Lib/json/tests/test_scanstring.py b/Lib/json/tests/test_scanstring.py
index cd205a4..025d15d 100644
--- a/Lib/json/tests/test_scanstring.py
+++ b/Lib/json/tests/test_scanstring.py
@@ -2,6 +2,7 @@ import sys
import decimal
from unittest import TestCase
+import json
import json.decoder
class TestScanString(TestCase):
@@ -101,3 +102,9 @@ class TestScanString(TestCase):
self.assertEquals(
scanstring('["Bad value", truth]', 2, None, True),
('Bad value', 12))
+
+ def test_issue3623(self):
+ self.assertRaises(ValueError, json.decoder.scanstring, b"xxx", 1,
+ "xxx")
+ self.assertRaises(UnicodeDecodeError,
+ json.encoder.encode_basestring_ascii, b"xx\xff")