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

Method test_ascii

Lib/test/test_capi/test_unicode.py:1816–1824  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1814 "ascii-latin1=\xE9-euro=\u20AC.")
1815
1816 def test_ascii(self):
1817 writer = self.create_writer(0)
1818 writer.write_ascii(b"Hello ", -1)
1819 writer.write_ascii(b"", 0)
1820 writer.write_ascii(NULL, 0)
1821 # CRASHES writer.write_ascii(NULL, 1)
1822 # CRASHES writer.write_ascii(NULL, -1)
1823 writer.write_ascii(b"Python! <truncated>", 6)
1824 self.assertEqual(writer.finish(), "Hello Python")
1825
1826 def test_invalid_utf8(self):
1827 writer = self.create_writer(0)

Callers

nothing calls this directly

Calls 3

create_writerMethod · 0.95
assertEqualMethod · 0.45
finishMethod · 0.45

Tested by

no test coverage detected