summaryrefslogtreecommitdiff
path: root/tests/test_rrset.py
diff options
context:
space:
mode:
authorBob Halley <halley@dnspython.org>2020-05-03 14:49:55 -0700
committerBob Halley <halley@dnspython.org>2020-05-03 14:49:55 -0700
commitf721d7b85d488327699e4cd0e71693dc8eb0f12e (patch)
treec37d252693a60d13d1846e1e7c8ab67ec48aa545 /tests/test_rrset.py
parentd413f2cfe3a9fbadfb442b6e607cf558789a33c9 (diff)
downloaddnspython-f721d7b85d488327699e4cd0e71693dc8eb0f12e.tar.gz
IDNA support for zones, messages, names in rdata, rrsets, and rdatasets.
Diffstat (limited to 'tests/test_rrset.py')
-rw-r--r--tests/test_rrset.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/test_rrset.py b/tests/test_rrset.py
index 638dff3..12eac3f 100644
--- a/tests/test_rrset.py
+++ b/tests/test_rrset.py
@@ -1,3 +1,4 @@
+# -*- coding: utf-8
# Copyright (C) Dnspython Contributors, see LICENSE for text of ISC license
# Copyright (C) 2003-2007, 2009-2011 Nominum, Inc.
@@ -17,6 +18,7 @@
import unittest
+import dns.name
import dns.rrset
class RRsetTestCase(unittest.TestCase):
@@ -52,5 +54,21 @@ class RRsetTestCase(unittest.TestCase):
r2 = dns.rrset.from_text('FOO', 30, 'in', 'a', '10.0.0.2', '10.0.0.1')
self.assertNotEqual(r1, r2)
+ def testCodec2003(self):
+ r1 = dns.rrset.from_text_list('Königsgäßchen', 30, 'in', 'ns',
+ ['Königsgäßchen'])
+ r2 = dns.rrset.from_text_list('xn--knigsgsschen-lcb0w', 30, 'in', 'ns',
+ ['xn--knigsgsschen-lcb0w'])
+ self.assertEqual(r1, r2)
+
+ def testCodec2008(self):
+ r1 = dns.rrset.from_text_list('Königsgäßchen', 30, 'in', 'ns',
+ ['Königsgäßchen'],
+ idna_codec=dns.name.IDNA_2008)
+ r2 = dns.rrset.from_text_list('xn--knigsgchen-b4a3dun', 30, 'in', 'ns',
+ ['xn--knigsgchen-b4a3dun'],
+ idna_codec=dns.name.IDNA_2008)
+ self.assertEqual(r1, r2)
+
if __name__ == '__main__':
unittest.main()