Debian Codegraph @

tests/test_idna_compat.py

raw
1 import unittest
2
3 import idna.compat
4
5
6 class IDNACompatTests(unittest.TestCase):
7 def testToASCII(self):
8 self.assertEqual(
9 idna.compat.ToASCII("\u30c6\u30b9\u30c8.xn--zckzah"),
10 b"xn--zckzah.xn--zckzah",
11 )
12
13 def testToUnicode(self):
14 self.assertEqual(
15 idna.compat.ToUnicode(b"xn--zckzah.xn--zckzah"),
16 "\u30c6\u30b9\u30c8.\u30c6\u30b9\u30c8",
17 )
18
19 def test_nameprep(self):
20 self.assertRaises(NotImplementedError, idna.compat.nameprep, "a")
21
22
23 if __name__ == "__main__":
24 unittest.main()