def test_check_domains_empty(self, gethostbyname_ex):
     gethostbyname_ex.return_value = ('example.com', [], ['12.2.2.2'])
     self.assertTrue(validators.check_domains(
         'example.com', []))
 def test_check_domains(self):
     test_domain = 'ossg.test.com'
     test_allowed = ['.example.com', '.test.com']
     self.assertTrue(validators.check_domains(test_domain, test_allowed))
     self.assertFalse(validators.check_domains('gmail.com', test_allowed))
Example #3
0
 def test_check_domains_empty(self):
     self.assertTrue(validators.check_domains('example.com', []))
 def test_check_domains_empty(self):
     self.assertTrue(validators.check_domains(
         'example.com', []))
 def test_check_domains(self):
     test_domain = 'ossg.test.com'
     test_allowed = ['.example.com', '.test.com']
     self.assertTrue(validators.check_domains(test_domain, test_allowed))
     self.assertFalse(validators.check_domains('gmail.com', test_allowed))