summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorPeter Thomassen <peter@desec.io>2022-01-24 11:14:03 +0100
committerBob Halley <halley@dnspython.org>2022-01-25 06:45:44 -0800
commit89dc78e4a3e20632e098def65c7296541f5d7dcd (patch)
tree9ce24d454856cd14833e7fd31ca2ffb0f980bbde /tests
parent4fd962a1e5a1af1b9177ba01e83792ef60d3a9d1 (diff)
downloaddnspython-89dc78e4a3e20632e098def65c7296541f5d7dcd.tar.gz
Require trailing field in rdata of TLSA and friends
(cherry picked from commit 4c70268984d865f8b0e93ca019518807af5fd344)
Diffstat (limited to 'tests')
-rw-r--r--tests/test_dnssec.py3
-rw-r--r--tests/test_rdata.py3
2 files changed, 5 insertions, 1 deletions
diff --git a/tests/test_dnssec.py b/tests/test_dnssec.py
index 12651d7..d4d7627 100644
--- a/tests/test_dnssec.py
+++ b/tests/test_dnssec.py
@@ -533,7 +533,8 @@ class DNSSECMakeDSTestCase(unittest.TestCase):
dns.rdata.from_text(dns.rdataclass.IN, dns.rdatatype.CDS, f'0 0 0 00')
test_records = {
- 'digest length inconsistent with digest type': ['0 0 0', '0 0 0 0000'],
+ 'expecting another identifier': ['0 0 0', '0 0 0 '],
+ 'digest length inconsistent with digest type': ['0 0 0 0000'],
'Odd-length string': ['0 0 0 0', '0 0 0 000'],
}
for msg, records in test_records.items():
diff --git a/tests/test_rdata.py b/tests/test_rdata.py
index f87ff56..c002e7a 100644
--- a/tests/test_rdata.py
+++ b/tests/test_rdata.py
@@ -539,6 +539,9 @@ class RdataTestCase(unittest.TestCase):
with self.assertRaises(dns.exception.SyntaxError):
dns.rdata.from_text('in', 'type45678', '\\# 6 000a03666f6f00')
+ def test_empty_generic(self):
+ dns.rdata.from_text('in', 'type45678', r'\# 0')
+
def test_covered_repr(self):
text = 'NSEC 1 3 3600 20190101000000 20030101000000 ' + \
'2143 foo Ym9ndXM='