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

Method test_array_decoder_issue46

simplejson/tests/test_fail.py:122–136  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

120 self.fail("Expected failure for fail%d.json: %r" % (idx, doc))
121
122 def test_array_decoder_issue46(self):
123 # http://code.google.com/p/simplejson/issues/detail?id=46
124 for doc in [u'[,]', '[,]']:
125 try:
126 json.loads(doc)
127 except json.JSONDecodeError:
128 e = sys.exc_info()[1]
129 self.assertEqual(e.pos, 1)
130 self.assertEqual(e.lineno, 1)
131 self.assertEqual(e.colno, 2)
132 except Exception:
133 e = sys.exc_info()[1]
134 self.fail("Unexpected exception raised %r %s" % (e, e))
135 else:
136 self.fail("Unexpected success parsing '[,]'")
137
138 def test_truncated_input(self):
139 test_cases = [

Callers

nothing calls this directly

Calls 1

loadsMethod · 0.80

Tested by

no test coverage detected