def test_good_domain(self): """Test with a known good domain We should get back a dictionary with the following keys: 'a', 'mx', 'whois', 'nameservers' """ response = check.full_search(GOOD_DOMAIN) self.assertIsInstance(response, dict) self.assertEqual(sorted(response.keys()), sorted(['a', 'mx', 'whois', 'nameservers']))
def test_bad_domain(self): """Test a known bad domain We should get back a dictionary with the following keys: 'a', 'mx', 'whois', 'nameservers' but with empty contents """ response = check.full_search(BAD_DOMAIN) self.assertIsInstance(response, dict) self.assertEqual(sorted(response.keys()), sorted(['a', 'mx', 'whois', 'nameservers'])) self.assertFalse(response['a']) self.assertFalse(response['mx']) self.assertFalse(response['nameservers']) self.assertIsInstance(response['whois'], basestring) self.assertFalse(response['whois'])