]> git.ipfire.org Git - thirdparty/dnspython.git/commitdiff
increase coverage for URI and SVCB processing_order() 579/head
authorBob Halley <halley@dnspython.org>
Wed, 9 Sep 2020 12:50:59 +0000 (05:50 -0700)
committerBob Halley <halley@dnspython.org>
Wed, 9 Sep 2020 12:50:59 +0000 (05:50 -0700)
tests/test_processing_order.py

index 2fa1b27124656e4c6d991dea997ad07f0db04161..45a90cff526442bcd216f32dcdde07bad75137e6 100644 (file)
@@ -102,3 +102,31 @@ def test_processing_all_zero_weight_srv():
             assert rds[j] in po
         seen.add(tuple(po))
     assert len(seen) == 6
+
+
+def test_processing_order_uri():
+    # We're testing here just to provide coverage for URI methods; the
+    # testing of the weighting algorithm is done above in tests with
+    # SRV.
+    rds = dns.rdataset.from_text('in', 'uri', 300,
+                                 '1 1 "ftp://ftp1.example.com/public"',
+                                 '2 2 "ftp://ftp2.example.com/public"',
+                                 '3 3 "ftp://ftp3.example.com/public"')
+    po = rds.processing_order()
+    assert len(po) == 3
+    for i in range(3):
+        assert po[i] == rds[i]
+
+
+def test_processing_order_svcb():
+    # We're testing here just to provide coverage for SVCB methods; the
+    # testing of the priority algorithm is done above in tests with
+    # MX and NAPTR.
+    rds = dns.rdataset.from_text('in', 'svcb', 300,
+                                 "1 . mandatory=alpn alpn=h2",
+                                 "2 . mandatory=alpn alpn=h2",
+                                 "3 . mandatory=alpn alpn=h2")
+    po = rds.processing_order()
+    assert len(po) == 3
+    for i in range(3):
+        assert po[i] == rds[i]