From: Michael Orlitzky Date: Thu, 15 Sep 2022 23:01:16 +0000 (-0400) Subject: bin/djbdns-logparse.py: more doctests for handle_tinydns_log(). X-Git-Tag: 0.0.1~42 X-Git-Url: https://gitweb.michael.orlitzky.com/?a=commitdiff_plain;h=e3c052b082c6c6183e0f299a1a0d73021f25f88d;p=djbdns-logparse.git bin/djbdns-logparse.py: more doctests for handle_tinydns_log(). --- diff --git a/bin/djbdns-logparse.py b/bin/djbdns-logparse.py index 33fc69d..d97a812 100755 --- a/bin/djbdns-logparse.py +++ b/bin/djbdns-logparse.py @@ -225,8 +225,13 @@ def handle_tinydns_log(line : str) -> bool: -------- >>> line = "2022-09-14 21:04:40.206516500 7f000001:9d61:be69 - 0001 www.example.com" - >>> _ = handle_tinydns_log(line) + >>> handle_tinydns_log(line) 2022-09-14 21:04:40.206516500 dropped query (no authority) from 127.0.0.1:40289 (id 48745): a www.example.com + True + + >>> line = "this line is nonsense" + >>> handle_tinydns_log(line) + False """ match = tinydns_log_re.match(line)