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, "*****@*****.**")
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)