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

Method assertScan

simplejson/tests/test_scanstring.py:175–182  ·  view source on GitHub ↗
(given, expect, test_utf8=True)

Source from the content-addressed store, hash-verified

173 scanstring = json.decoder.scanstring
174
175 def assertScan(given, expect, test_utf8=True):
176 givens = [given]
177 if not PY3 and test_utf8:
178 givens.append(given.encode('utf8'))
179 for given in givens:
180 (res, count) = scanstring(given, 1, None, True)
181 self.assertEqual(len(given), count)
182 self.assertEqual(res, expect)
183
184 assertScan(
185 u'"z\\ud834\\u0079x"',

Callers

nothing calls this directly

Calls 1

encodeMethod · 0.45

Tested by

no test coverage detected