summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorBob Halley <halley@dnspython.org>2020-08-10 18:12:29 -0700
committerBob Halley <halley@dnspython.org>2020-08-10 18:13:31 -0700
commit8a032fa375555b83d31df77191dd66e669421ab7 (patch)
tree714c2e8ce9aee0365f11fc3f1a4172b56486d296 /tests
parent2b4134ed9f8358e61a342d632b96abdec50161bd (diff)
downloaddnspython-8a032fa375555b83d31df77191dd66e669421ab7.tar.gz
detect various bad ttls
Diffstat (limited to 'tests')
-rw-r--r--tests/test_ttl.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/test_ttl.py b/tests/test_ttl.py
index 07c512b..2bf298e 100644
--- a/tests/test_ttl.py
+++ b/tests/test_ttl.py
@@ -22,3 +22,15 @@ class TTLTestCase(unittest.TestCase):
def test_bind_style_no_unit(self):
with self.assertRaises(dns.ttl.BadTTL):
dns.ttl.from_text('1d5')
+
+ def test_bind_style_leading_unit(self):
+ with self.assertRaises(dns.ttl.BadTTL):
+ dns.ttl.from_text('s')
+
+ def test_bind_style_unit_without_digits(self):
+ with self.assertRaises(dns.ttl.BadTTL):
+ dns.ttl.from_text('1mw')
+
+ def test_empty(self):
+ with self.assertRaises(dns.ttl.BadTTL):
+ dns.ttl.from_text('')