From: Bob Halley Date: Wed, 9 Sep 2020 12:50:59 +0000 (-0700) Subject: increase coverage for URI and SVCB processing_order() X-Git-Tag: v2.1.0rc1~17^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F579%2Fhead;p=thirdparty%2Fdnspython.git increase coverage for URI and SVCB processing_order() --- diff --git a/tests/test_processing_order.py b/tests/test_processing_order.py index 2fa1b271..45a90cff 100644 --- a/tests/test_processing_order.py +++ b/tests/test_processing_order.py @@ -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]