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

Method test_paste_mid_newlines

Lib/test/test_pyrepl/test_pyrepl.py:1737–1759  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1735 self.assertEqual(output, code)
1736
1737 def test_paste_mid_newlines(self):
1738 # fmt: off
1739 code = (
1740 "def f():\n"
1741 " x = y\n"
1742 " \n"
1743 " y = z\n"
1744 )
1745 # fmt: on
1746
1747 events = itertools.chain(
1748 [
1749 Event(evt="key", data="f3", raw=bytearray(b"\x1bOR")),
1750 ],
1751 code_to_events(code),
1752 [
1753 Event(evt="key", data="f3", raw=bytearray(b"\x1bOR")),
1754 ],
1755 code_to_events("\n"),
1756 )
1757 reader = self.prepare_reader(events)
1758 output = multiline_input(reader)
1759 self.assertEqual(output, code)
1760
1761 def test_paste_mid_newlines_not_in_paste_mode(self):
1762 # fmt: off

Callers

nothing calls this directly

Calls 6

prepare_readerMethod · 0.95
EventClass · 0.90
code_to_eventsFunction · 0.85
multiline_inputFunction · 0.85
chainMethod · 0.80
assertEqualMethod · 0.45

Tested by

no test coverage detected