summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorBob Halley <halley@dnspython.org>2021-05-18 06:59:58 -0700
committerBob Halley <halley@dnspython.org>2021-05-18 06:59:58 -0700
commit2dab021d03750b56cb4eca5420603f5471054a6e (patch)
treedd0eb92712bd1b5f14e3f77444b6c103ac0eabb0 /tests
parenta8253e123b291e767548bb98cb00a81181076631 (diff)
downloaddnspython-2dab021d03750b56cb4eca5420603f5471054a6e.tar.gz
Eliminate the need for a serial parameter to inbound_xfr()
Diffstat (limited to 'tests')
-rw-r--r--tests/test_xfr.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/test_xfr.py b/tests/test_xfr.py
index c1a011c..7429fa3 100644
--- a/tests/test_xfr.py
+++ b/tests/test_xfr.py
@@ -593,6 +593,21 @@ def test_make_query_bad_serial():
with pytest.raises(ValueError):
dns.xfr.make_query(z, serial=4294967296)
+def test_extract_serial_from_query():
+ z = dns.versioned.Zone('example.')
+ (q, s) = dns.xfr.make_query(z)
+ xs = dns.xfr.extract_serial_from_query(q)
+ assert s is None
+ assert s == xs
+ (q, s) = dns.xfr.make_query(z, serial=10)
+ print(q)
+ xs = dns.xfr.extract_serial_from_query(q)
+ assert s == 10
+ assert s == xs
+ q = dns.message.make_query('example', 'a')
+ with pytest.raises(ValueError):
+ dns.xfr.extract_serial_from_query(q)
+
class XFRNanoNameserver(Server):