MCPcopy Create free account
hub / github.com/simplejson/simplejson / test_overflow

Method test_overflow

simplejson/tests/test_scanstring.py:145–150  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

143 json.encoder.encode_basestring_ascii, b("xx\xff"))
144
145 def test_overflow(self):
146 # Python 2.5 does not have maxsize, Python 3 does not have maxint
147 maxsize = getattr(sys, 'maxsize', getattr(sys, 'maxint', None))
148 assert maxsize is not None
149 self.assertRaises(OverflowError, json.decoder.scanstring, "xxx",
150 maxsize + 1)
151
152 def test_end_out_of_bounds_is_jsondecodeerror(self):
153 # Regression: C scanstring used to raise a plain ValueError for

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected