MCPcopy Index your code
hub / github.com/python/cpython / test_format_i

Method test_format_i

Lib/test/test_capi/test_bytes.py:364–373  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

362 self.assertEqual(writer.finish(), self.result_type(b'number=123456'))
363
364 def test_format_i(self):
365 # Test PyBytesWriter_Format()
366 writer = self.create_writer()
367 writer.format_i(b'x=%i', 123456)
368 self.assertEqual(writer.finish(), self.result_type(b'x=123456'))
369
370 writer = self.create_writer()
371 writer.format_i(b'x=%i, ', 123)
372 writer.format_i(b'y=%i', 456)
373 self.assertEqual(writer.finish(), self.result_type(b'x=123, y=456'))
374
375 def test_example_abc(self):
376 self.assertEqual(_testcapi.byteswriter_abc(), b'abc')

Callers

nothing calls this directly

Calls 3

create_writerMethod · 0.95
assertEqualMethod · 0.45
finishMethod · 0.45

Tested by

no test coverage detected