コード例 #1
0
 def test_is_whitelisted_for_domain(self) -> None:
     """
     Test a given email passes domain whitelist check against ccla_signature
     """
     signature = Signature()
     signature.get_domain_whitelist = Mock(return_value=[".gmail.com"])
     self.assertTrue(utils.is_whitelisted(signature, email="*****@*****.**"))
     self.assertFalse(utils.is_whitelisted(signature, email="*****@*****.**"))
コード例 #2
0
 def test_is_whitelisted_for_github(self) -> None:
     """
     Test given github user passes github whitelist check against ccla_signature
     """
     signature = Signature()
     signature.get_github_whitelist = Mock(return_value=['foo'])
     self.assertTrue(utils.is_whitelisted(signature, github_username='******'))
     self.assertFalse(utils.is_whitelisted(signature, github_username='******'))
コード例 #3
0
 def test_is_whitelisted_for_email(self) -> None:
     """
     Test a given email to check if whitelisted against ccla_signature
     """
     signature = Signature()
     signature.get_email_whitelist = Mock(return_value={"*****@*****.**"})
     self.assertTrue(utils.is_whitelisted(signature, email="*****@*****.**"))
     self.assertFalse(utils.is_whitelisted(signature, email="*****@*****.**"))
コード例 #4
0
ファイル: test_utils.py プロジェクト: prasannamahajan/easycla
 def test_is_whitelisted_for_github_org(self) -> None:
     """
     Test given github user passes github org check against ccla_signature
     """
     self.mock_get.return_value.ok = True
     github_orgs = [{
         'login': '******',
     }]
     self.mock_get.return_value = Mock()
     self.mock_get.return_value.json.return_value = github_orgs
     signature = Signature()
     signature.get_github_org_whitelist = Mock(return_value=['foo-org'])
     self.assertTrue(utils.is_whitelisted(signature, github_username='******'))