]> git.proxmox.com Git - mirror_edk2.git/blame - AppPkg/Applications/Python/Python-2.7.10/Lib/json/tests/test_speedups.py
AppPkg/Applications/Python/Python-2.7.10: Initial Checkin part 4/5.
[mirror_edk2.git] / AppPkg / Applications / Python / Python-2.7.10 / Lib / json / tests / test_speedups.py
CommitLineData
3257aa99
DM
1from json.tests import CTest\r
2\r
3\r
4class TestSpeedups(CTest):\r
5 def test_scanstring(self):\r
6 self.assertEqual(self.json.decoder.scanstring.__module__, "_json")\r
7 self.assertIs(self.json.decoder.scanstring, self.json.decoder.c_scanstring)\r
8\r
9 def test_encode_basestring_ascii(self):\r
10 self.assertEqual(self.json.encoder.encode_basestring_ascii.__module__,\r
11 "_json")\r
12 self.assertIs(self.json.encoder.encode_basestring_ascii,\r
13 self.json.encoder.c_encode_basestring_ascii)\r
14\r
15class TestDecode(CTest):\r
16 def test_make_scanner(self):\r
17 self.assertRaises(AttributeError, self.json.scanner.c_make_scanner, 1)\r
18\r
19 def test_make_encoder(self):\r
20 self.assertRaises(TypeError, self.json.encoder.c_make_encoder,\r
21 None,\r
22 "\xCD\x7D\x3D\x4E\x12\x4C\xF9\x79\xD7\x52\xBA\x82\xF2\x27\x4A\x7D\xA0\xCA\x75",\r
23 None)\r