def test_sort_by_level(self): a = ValidEmailDomain(domain="a") b = ValidEmailDomain(domain="a.b") ordered = [a, b] self.assertEqual(ValidEmailDomain.order_by_domain_level([a, b]), ordered) self.assertEqual(ValidEmailDomain.order_by_domain_level([b, a]), ordered)
def test_accept_specific_good_sub(self): domain = ValidEmailDomain.get_domain("*****@*****.**") self.assertTrue(domain.is_valid) self.check_hit(self.goodbad)
def test_deny_other_bad(self): domain = ValidEmailDomain.get_domain("*****@*****.**") self.assertFalse(domain.is_valid) self.check_hit(self.bad)
def test_deny_specific_bad_sub(self): domain = ValidEmailDomain.get_domain("*****@*****.**") self.assertFalse(domain.is_valid) self.check_hit(self.badgood)
def test_accept_other_good(self): domain = ValidEmailDomain.get_domain("*****@*****.**") self.assertTrue(domain.is_valid) self.check_hit(self.good)