Home | History | Annotate | Download | only in test_json
      1 from test.test_json import CTest
      2 
      3 
      4 class TestSpeedups(CTest):
      5     def test_scanstring(self):
      6         self.assertEqual(self.json.decoder.scanstring.__module__, "_json")
      7         self.assertIs(self.json.decoder.scanstring, self.json.decoder.c_scanstring)
      8 
      9     def test_encode_basestring_ascii(self):
     10         self.assertEqual(self.json.encoder.encode_basestring_ascii.__module__,
     11                          "_json")
     12         self.assertIs(self.json.encoder.encode_basestring_ascii,
     13                       self.json.encoder.c_encode_basestring_ascii)
     14 
     15 
     16 class TestDecode(CTest):
     17     def test_make_scanner(self):
     18         self.assertRaises(AttributeError, self.json.scanner.c_make_scanner, 1)
     19 
     20     def test_make_encoder(self):
     21         self.assertRaises(TypeError, self.json.encoder.c_make_encoder,
     22             (True, False),
     23             b"\xCD\x7D\x3D\x4E\x12\x4C\xF9\x79\xD7\x52\xBA\x82\xF2\x27\x4A\x7D\xA0\xCA\x75",
     24             None)
     25