From: kimbo Date: Sat, 27 Jul 2019 03:24:56 +0000 (-0400) Subject: tests for alternate dots for root in dns.name.from_unicode X-Git-Tag: v2.0.0rc1~362^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=301e3a6cf9b4dadc88a74312bd37d1a91aaadd85;p=thirdparty%2Fdnspython.git tests for alternate dots for root in dns.name.from_unicode --- diff --git a/tests/test_name.py b/tests/test_name.py index da576d90..de1e9f89 100644 --- a/tests/test_name.py +++ b/tests/test_name.py @@ -669,6 +669,22 @@ class NameTestCase(unittest.TestCase): n = dns.name.from_text('foo\uff61bar') self.assertEqual(n.labels, (b'foo', b'bar', b'')) + def testFromUnicodeRoot(self): + n = dns.name.from_text('.') + self.assertEqual(n.labels, (b'',)) + + def testFromUnicodeAlternateRoot1(self): + n = dns.name.from_text('\u3002') + self.assertEqual(n.labels, (b'',)) + + def testFromUnicodeAlternateRoot2(self): + n = dns.name.from_text('\uff0e') + self.assertEqual(n.labels, (b'',)) + + def testFromUnicodeAlternateRoot3(self): + n = dns.name.from_text('\uff61') + self.assertEqual(n.labels, (b'', )) + def testFromUnicodeIDNA2003Explicit(self): t = 'Königsgäßchen' e = dns.name.from_unicode(t, idna_codec=dns.name.IDNA_2003)