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

Method test_escape_sequences

Lib/test/test_pyrepl/test_keymap.py:26–31  ·  view source on GitHub ↗

Ensure that escaping sequences are parsed to their corresponding mapping.

(self)

Source from the content-addressed store, hash-verified

24 self.assertEqual(parse_keys(test_key), expected_keys)
25
26 def test_escape_sequences(self):
27 """Ensure that escaping sequences are parsed to their corresponding mapping."""
28 test_cases = [(f"\\{escape}", [parsed_escape]) for escape, parsed_escape in _escapes.items()]
29 for test_key, expected_keys in test_cases:
30 with self.subTest(f"{test_key} should be parsed as {expected_keys}"):
31 self.assertEqual(parse_keys(test_key), expected_keys)
32
33 def test_control_sequences(self):
34 """Ensure that supported control sequences are parsed successfully."""

Callers

nothing calls this directly

Calls 4

parse_keysFunction · 0.90
itemsMethod · 0.45
subTestMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected