Пример #1
0
 def test_get_org(self):
     mock = MagicMock()
     mock_response = MagicMock()
     mock_response.email = "*****@*****.**"
     mock.get_organization.return_value = mock_response
     client = SourceControlClient(mock, mock, mock)
     org = client.get_organisation("wu-tang-financial")
     self.assertEqual(org.email, "*****@*****.**")
Пример #2
0
 def test_get_org_failure(self):
     mock = MagicMock()
     mock.get_organization.side_effect = GithubException(404, "Not Found")
     client = SourceControlClient(mock, mock, mock)
     org = client.get_organisation(123)
     self.assertFalse(org)