From 539883bb8de07535cad42607bef515c973fa1e3e Mon Sep 17 00:00:00 2001 From: Brian Wellington Date: Mon, 11 May 2020 10:22:48 -0700 Subject: [PATCH] Add more nsec3_hash() tests. --- tests/test_nsec3_hash.py | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/tests/test_nsec3_hash.py b/tests/test_nsec3_hash.py index c242a819..58bdeb36 100644 --- a/tests/test_nsec3_hash.py +++ b/tests/test_nsec3_hash.py @@ -1,6 +1,6 @@ import unittest -from dns import dnssec +from dns import dnssec,name class NSEC3Hash(unittest.TestCase): @@ -33,6 +33,22 @@ class NSEC3Hash(unittest.TestCase): ("www.test.domain.dev.", "B4", 2, "nv7ti6brgh94ke2f3pgiigjevfgpo5j0", 1), ("*.test-domain.dev", "", 0, "o6uadafckb6hea9qpcgir2gl71vt23gu", 1), ("*.test-domain.dev", "", 45, "505k9g118d9sofnjhh54rr8fadgpa0ct", 1), + # Alternate forms of parameters + ( + name.from_text("example"), + "aabbccdd", + 12, + "0p9mhaveqvm6t7vbl5lop2u3t2rp3tom", + 1, + ), + ( + "example", + b"\xaa\xbb\xcc\xdd", + 12, + "0p9mhaveqvm6t7vbl5lop2u3t2rp3tom", + 1, + ), + ("*.test-domain.dev", None, 45, "505k9g118d9sofnjhh54rr8fadgpa0ct", 1), ] def test_hash_function(self): -- 2.47.3