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

Method test_aliases

Lib/test/test_ucn.py:151–175  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

149 self.checkletter("FULLWIDTH LATIN SMALL LETTER A", "\uFF41")
150
151 def test_aliases(self):
152 # Check that the aliases defined in the NameAliases.txt file work.
153 # This should be updated when new aliases are added or the file
154 # should be downloaded and parsed instead. See #12753.
155 aliases = [
156 ('LATIN CAPITAL LETTER GHA', 0x01A2),
157 ('LATIN SMALL LETTER GHA', 0x01A3),
158 ('KANNADA LETTER LLLA', 0x0CDE),
159 ('LAO LETTER FO FON', 0x0E9D),
160 ('LAO LETTER FO FAY', 0x0E9F),
161 ('LAO LETTER RO', 0x0EA3),
162 ('LAO LETTER LO', 0x0EA5),
163 ('TIBETAN MARK BKA- SHOG GI MGO RGYAN', 0x0FD0),
164 ('YI SYLLABLE ITERATION MARK', 0xA015),
165 ('PRESENTATION FORM FOR VERTICAL RIGHT WHITE LENTICULAR BRACKET', 0xFE18),
166 ('BYZANTINE MUSICAL SYMBOL FTHORA SKLIRON CHROMA VASIS', 0x1D0C5)
167 ]
168 for alias, codepoint in aliases:
169 self.checkletter(alias, chr(codepoint))
170 name = unicodedata.name(chr(codepoint))
171 self.assertNotEqual(name, alias)
172 self.assertEqual(unicodedata.lookup(alias),
173 unicodedata.lookup(name))
174 with self.assertRaises(KeyError):
175 unicodedata.ucd_3_2_0.lookup(alias)
176
177 def test_aliases_names_in_pua_range(self):
178 # We are storing aliases in the PUA 15, but their names shouldn't leak

Callers

nothing calls this directly

Calls 6

checkletterMethod · 0.95
assertNotEqualMethod · 0.80
nameMethod · 0.45
assertEqualMethod · 0.45
lookupMethod · 0.45
assertRaisesMethod · 0.45

Tested by

no test coverage detected