def test_invalid_domain(self): domain_dic = { 'domain_name': "www.google.com", 'class': "IN", 'qtype': "A", 'data': "1.2.3.4", 'ttl': 3600 } result = validate_new_domain(" " + domain_dic['class'] + " " + domain_dic['qtype'] + " " + domain_dic['data']) self.assertIsNone(result) result = validate_new_domain(domain_dic['domain_name'] + " " + domain_dic['qtype'] + " " + domain_dic['data']) self.assertIsNone(result) result = validate_new_domain(domain_dic['domain_name'] + " " + domain_dic['class'] + " " + domain_dic['data']) self.assertIsNone(result) result = validate_new_domain(domain_dic['domain_name'] + " " + domain_dic['class'] + " " + domain_dic['qtype']) self.assertIsNone(result) result = validate_new_domain("Domain: " + domain_dic['domain_name'] + " " + domain_dic['class'] + " " + domain_dic['qtype'] + " " + domain_dic['data']) self.assertIsNone(result)
def test_domain_integer(self): result = validate_new_domain(1345) self.assertIsNone(result)
def test_domain_string(self): result = validate_new_domain("abcDE%^$#!Fgh") self.assertIsNone(result)
def test_domain_null(self): result = validate_new_domain(None) self.assertIsNone(result)