MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_basic_line_wrap

Method test_basic_line_wrap

Lib/test/test_pprint.py:285–319  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

283 self.assertEqual(pprint.saferepr(cont), expected)
284
285 def test_basic_line_wrap(self):
286 # verify basic line-wrapping operation
287 o = {'RPM_cal': 0,
288 'RPM_cal2': 48059,
289 'Speed_cal': 0,
290 'controldesk_runtime_us': 0,
291 'main_code_runtime_us': 0,
292 'read_io_runtime_us': 0,
293 'write_io_runtime_us': 43690}
294 exp = """\
295{'RPM_cal': 0,
296 'RPM_cal2': 48059,
297 'Speed_cal': 0,
298 'controldesk_runtime_us': 0,
299 'main_code_runtime_us': 0,
300 'read_io_runtime_us': 0,
301 'write_io_runtime_us': 43690}"""
302 for type in [dict, dict2]:
303 self.assertEqual(pprint.pformat(type(o)), exp)
304
305 o = range(100)
306 exp = '[%s]' % ',\n '.join(map(str, o))
307 for type in [list, list2]:
308 self.assertEqual(pprint.pformat(type(o)), exp)
309
310 o = tuple(range(100))
311 exp = '(%s)' % ',\n '.join(map(str, o))
312 for type in [tuple, tuple2]:
313 self.assertEqual(pprint.pformat(type(o)), exp)
314
315 # indent parameter
316 o = range(100)
317 exp = '[ %s]' % ',\n '.join(map(str, o))
318 for type in [list, list2]:
319 self.assertEqual(pprint.pformat(type(o), indent=4), exp)
320
321 def test_nested_indentations(self):
322 o1 = list(range(10))

Callers

nothing calls this directly

Calls 3

pformatMethod · 0.80
assertEqualMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected