diff options
author | Bob Halley <halley@dnspython.org> | 2020-09-09 05:50:59 -0700 |
---|---|---|
committer | Bob Halley <halley@dnspython.org> | 2020-09-09 05:50:59 -0700 |
commit | 60657b69343db0dbaa32bff12308081f91e7526f (patch) | |
tree | e3cdf75ab20e62f52a2eeeddd126227019c2e68f | |
parent | ba56a756392a996282f6b62fbecb73757a1619a0 (diff) | |
download | dnspython-60657b69343db0dbaa32bff12308081f91e7526f.tar.gz |
increase coverage for URI and SVCB processing_order()
-rw-r--r-- | tests/test_processing_order.py | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/test_processing_order.py b/tests/test_processing_order.py index 2fa1b27..45a90cf 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] |