]> git.ipfire.org Git - thirdparty/dnspython.git/commitdiff
fix more IDNA tests
authorBob Halley <halley@dnspython.org>
Sat, 7 Feb 2026 15:51:25 +0000 (07:51 -0800)
committerBob Halley <halley@dnspython.org>
Sat, 7 Feb 2026 15:51:25 +0000 (07:51 -0800)
tests/test_rdata.py
tests/test_rdataset.py
tests/test_zone.py

index 6691fa7c7d347dde9dcaeea20be72c29865e6a43..01dc7def95f97a495ab5f7020a7d7b5d14220fcb 100644 (file)
@@ -183,7 +183,10 @@ class RdataTestCase(unittest.TestCase):
 
     def test_unicode_idna2003_in_rdata(self):
         rdata = dns.rdata.from_text(
-            dns.rdataclass.IN, dns.rdatatype.NS, "Königsgäßchen"
+            dns.rdataclass.IN,
+            dns.rdatatype.NS,
+            "Königsgäßchen",
+            idna_codec=dns.name.IDNA_2003,
         )
         self.assertEqual(str(rdata.target), "xn--knigsgsschen-lcb0w")
 
index 4c602f8930d9b98149669f19bbf97d83bbc218eb..e596fabc43529ee4d863cdd51b5f49a7b294c650 100644 (file)
@@ -12,7 +12,9 @@ import dns.rdatatype
 
 class RdatasetTestCase(unittest.TestCase):
     def testCodec2003(self):
-        r1 = dns.rdataset.from_text_list("in", "ns", 30, ["Königsgäßchen"])
+        r1 = dns.rdataset.from_text_list(
+            "in", "ns", 30, ["Königsgäßchen"], idna_codec=dns.name.IDNA_2003
+        )
         r2 = dns.rdataset.from_text_list("in", "ns", 30, ["xn--knigsgsschen-lcb0w"])
         self.assertEqual(r1, r2)
 
index 1e154f84b4784023c1cbb1607ec8c1a69110684b..6b354cd40967b954eeb45086d53d6f1a3a6e3f5d 100644 (file)
@@ -168,7 +168,9 @@ $ORIGIN example.
 """
 
 include_text = """$INCLUDE "%s"
-""" % here("example")
+""" % here(
+    "example"
+)
 
 bad_directive_text = """$FOO bar
 $ORIGIN example.
@@ -983,7 +985,9 @@ class ZoneTestCase(unittest.TestCase):
         self.assertEqual(z1_rel, z2_rel)
 
     def testCodec2003(self):
-        z = dns.zone.from_text(codec_text, "example.", relativize=True)
+        z = dns.zone.from_text(
+            codec_text, "example.", relativize=True, idna_codec=dns.name.IDNA_2003
+        )
         n2003 = dns.name.from_text("xn--knigsgsschen-lcb0w", None)
         n2008 = dns.name.from_text("xn--knigsgchen-b4a3dun", None)
         self.assertTrue(n2003 in z)