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

Method test_single_character

Lib/test/test_pyrepl/test_keymap.py:8–13  ·  view source on GitHub ↗

Ensure that single ascii characters or single digits are parsed as single characters.

(self)

Source from the content-addressed store, hash-verified

6
7class TestParseKeys(unittest.TestCase):
8 def test_single_character(self):
9 """Ensure that single ascii characters or single digits are parsed as single characters."""
10 test_cases = [(key, [key]) for key in string.ascii_letters + string.digits]
11 for test_key, expected_keys in test_cases:
12 with self.subTest(f"{test_key} should be parsed as {expected_keys}"):
13 self.assertEqual(parse_keys(test_key), expected_keys)
14
15 def test_keynames(self):
16 """Ensure that keynames are parsed to their corresponding mapping.

Callers

nothing calls this directly

Calls 3

parse_keysFunction · 0.90
subTestMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected