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

Method test_encode

Lib/test/test_codecs.py:1357–1367  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1355
1356class PunycodeTest(unittest.TestCase):
1357 def test_encode(self):
1358 for uni, puny in punycode_testcases:
1359 # Need to convert both strings to lower case, since
1360 # some of the extended encodings use upper case, but our
1361 # code produces only lower case. Converting just puny to
1362 # lower is also insufficient, since some of the input characters
1363 # are upper case.
1364 self.assertEqual(
1365 str(uni.encode("punycode"), "ascii").lower(),
1366 str(puny, "ascii").lower()
1367 )
1368
1369 def test_decode(self):
1370 for uni, puny in punycode_testcases:

Callers

nothing calls this directly

Calls 4

strFunction · 0.85
assertEqualMethod · 0.45
lowerMethod · 0.45
encodeMethod · 0.45

Tested by

no test coverage detected