From 184d316501e919c491e95144c37b69963b63b59e Mon Sep 17 00:00:00 2001 From: changeme Date: Wed, 24 Jun 2020 20:29:31 +0200 Subject: [PATCH] Added some very basic unit-tests --- src/test_ddns_update.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 src/test_ddns_update.py diff --git a/src/test_ddns_update.py b/src/test_ddns_update.py new file mode 100644 index 0000000..a091beb --- /dev/null +++ b/src/test_ddns_update.py @@ -0,0 +1,20 @@ +import unittest +from .ddns_update import response_successful + +class TestDdnsUpdate(unittest.TestCase): + + def test_response_successful(self): + self.assertTrue(response_successful("good")) + self.assertTrue(response_successful("good 1.2.3.4")) + self.assertTrue(response_successful("good abcd:abcd:abcd:abcd:abcd:abcd:abcd:abcd")) + self.assertTrue(response_successful("nochg")) + self.assertTrue(response_successful("nochg 1.2.3.4")) + self.assertTrue(response_successful("nochg abcd:abcd:abcd:abcd:abcd:abcd:abcd:abcd")) + self.assertFalse(response_successful("notfqdn")) + self.assertFalse(response_successful("nohost")) + self.assertFalse(response_successful("numhost")) + self.assertFalse(response_successful("abuse")) + self.assertFalse(response_successful("badagent")) + self.assertFalse(response_successful("dnserr")) + self.assertFalse(response_successful("911")) +