def test_LIST_filters(self, request_method): request_method.return_value = mock_response_result() self.rs.list('octoc', type='public').all() self.assertEqual(request_method.call_args[0], ('get', _('users/octoc/repos'))) self.assertEqual(request_method.call_args[1]['params']['type'], 'public')
def test_LIST_BY_ORG_filters(self, request_method): request_method.return_value = mock_response_result() self.rs.list_by_org('org_name', type='public').all() self.assertEqual(request_method.call_args[0], ('get', _('orgs/org_name/repos'))) self.assertEqual(request_method.call_args[1]['params']['type'], 'public')
def test_LIST_COMMITS(self, reqm): reqm.return_value = mock_response_result('get') self.service.list_commits(123).all() self.assertEqual( reqm.call_args[0], ('get', _('repos/user/repo/pulls/123/commits')) )
def test_LIST(self, reqm): reqm.return_value = mock_response_result() self.service.list().all() self.assertEqual( reqm.call_args[0], ('get', _('repos/user/repo/pulls')) )
def test_LIST(self, reqm): reqm.return_value = mock_response_result() self.service.list().all() self.assertEqual( reqm.call_args[0], ('get', _('repos/user/repo/git/refs')) )
def test_LIST_without_user(self, request_method): request_method.return_value = mock_response_result() self.rs.set_user('') self.rs.list().all() self.assertEqual(request_method.call_args[0], ('get', _('user/repos')))
def test_LIST(self, request_method): request_method.return_value = mock_response_result() self.cs.list().all() self.assertEqual(request_method.call_args[0], ('get', _('repos/octocat/oc_repo/collaborators')))
def test_LIST(self, request_method): request_method.return_value = mock_response_result() self.hs.list().all() self.assertEqual(request_method.call_args[0], ('get', _('repos/oct/re_oct/hooks')))
def test_REMOVE_TEAM_REPO(self, request_method): request_method.return_value = mock_response_result('delete') self.ts.remove_repo(1, 'octocat', 're_oct') self.assertEqual(request_method.call_args[0], ('delete', _('teams/1/repos/octocat/re_oct')))
def test_REMOVE_MEMBER(self, request_method): request_method.return_value = mock_response_result('delete') self.ts.remove_member(1, 'octocat') self.assertEqual(request_method.call_args[0], ('delete', _('teams/1/members/octocat')))
def test_CREATE(self, request_method): request_method.return_value = mock_response_result('post') self.ts.create('acme', dict(name='new')) self.assertEqual(request_method.call_args[0], ('post', _('orgs/acme/teams')))
def test_LIST_without_user(self, request_method): request_method.return_value = mock_response_result() self.isu.list().all() self.assertEqual(request_method.call_args[0], ('get', _('issues')))
def test_ADD_MEMBER(self, request_method): request_method.return_value = mock_response_result() self.ts.add_member(1, 'octocat') self.assertEqual(request_method.call_args[0], ('put', _('teams/1/members/octocat')))
def test_DELETE(self, request_method): request_method.return_value = mock_response_result('delete') self.ts.delete(1) self.assertEqual(request_method.call_args[0], ('delete', _('teams/1')))
def test_UPDATE(self, request_method): request_method.return_value = mock_response_result() self.ts.update(1, dict(name='edited')) self.assertEqual(request_method.call_args[0], ('patch', _('teams/1')))
def test_GET(self, request_method): request_method.return_value = mock_response_result() self.ts.get(1) self.assertEqual(request_method.call_args[0], ('get', _('teams/1')))
def test_LIST_REPOS(self, request_method): request_method.return_value = mock_response_result() self.ts.list_repos(1).all() self.assertEqual(request_method.call_args[0], ('get', _('teams/1/repos')))
def test_CONTAINS_REPO(self, request_method): request_method.return_value = mock_response_result() self.ts.contains_repo(1, 'octocat', 're_oct') self.assertEqual(request_method.call_args[0], ('head', _('teams/1/repos/octocat/re_oct')))
def test_LIST_by_issue(self, request_method): request_method.return_value = mock_response_result() self.ev.list_by_issue(1).all() self.assertEqual( request_method.call_args[0], ('get', _('repos/octocat/Hello-World/issues/1/events')))
def test_ADD_TEAM_REPO(self, request_method): request_method.return_value = mock_response_result() self.ts.add_repo(1, 'octocat', 're_oct') self.assertEqual(request_method.call_args[0], ('put', _('teams/1/repos/octocat/re_oct')))
def test_LIST_PUBLIC(self, request_method): request_method.return_value = mock_response_result() self.ms.list_public('acme').all() self.assertEqual(request_method.call_args[0], ('get', _('orgs/acme/public_members')))
def test_LIST(self, request_method): request_method.return_value = mock_response_result() self.ts.list('acme').all() self.assertEqual(request_method.call_args[0], ('get', _('orgs/acme/teams')))
def test_LIST_branches(self, request_method): request_method.return_value = mock_response_result() self.rs.list_branches().all() self.assertEqual(request_method.call_args[0], ('get', _('repos/octocat/octocat_repo/branches')))
def test_LIST_repos_with_user(self, request_method): request_method.return_value = mock_response_result() self.ws.list_repos('oct').all() self.assertEqual(request_method.call_args[0], ('get', _('users/oct/watched')))
def test_LIST_comments_for_commit(self, request_method): request_method.return_value = mock_response_result() self.cs.list_comments(sha='e3bc').all() self.assertEqual(request_method.call_args[0], ('get', _('repos/oct/re_oct/commits/e3bc/comments')))
def test_LIST_BY_ORG(self, request_method): request_method.return_value = mock_response_result() self.rs.list_by_org('org_name').all() self.assertEqual(request_method.call_args[0], ('get', _('orgs/org_name/repos')))
def test_LIST_FOLLOWING_with_user(self, request_method): request_method.return_value = mock_response_result() self.fs.list_following('octocat').all() self.assertEqual(request_method.call_args[0], ('get', _('users/octocat/following')))
def test_LIST_contributors(self, request_method): request_method.return_value = mock_response_result() self.rs.list_contributors().all() self.assertEqual(request_method.call_args[0], ('get', _('repos/octocat/octocat_repo/contributors')))
def test_LIST(self, reqm): reqm.return_value = mock_response_result(200) self.service.list(123).all() self.assertEqual(reqm.call_args[0], ('get', _('repos/user/repo/pulls/123/comments')))
def test_LIST(self, request_method): request_method.return_value = mock_response_result() self.es.list().all() self.assertEqual(request_method.call_args[0], ('get', _('user/emails')))
def test_LIST_with_user(self, request_method): request_method.return_value = mock_response_result() self.gs.list('octocat').all() self.assertEqual(request_method.call_args[0], ('get', _('users/octocat/gists')))
def test_LIST_public(self, request_method): request_method.return_value = mock_response_result() self.gs.public().all() self.assertEqual(request_method.call_args[0], ('get', _('gists/public')))
def test_LIST_FILES(self, reqm): reqm.return_value = mock_response_result('get') self.service.list_files(123).all() self.assertEqual(reqm.call_args[0], ('get', _('repos/user/repo/pulls/123/files')))
def test_LIST_starred(self, request_method): request_method.return_value = mock_response_result() self.gs.starred().all() self.assertEqual(request_method.call_args[0], ('get', _('gists/starred')))
def test_LIST_by_repo(self, request_method): request_method.return_value = mock_response_result() self.mi.list().all() self.assertEqual(request_method.call_args[0], ('get', _('repos/octocat/Hello-World/milestones')))
def test_LIST(self, request_method): request_method.return_value = mock_response_result() self.cs.list(1).all() self.assertEqual(request_method.call_args[0], ('get', _('gists/1/comments')))
def test_LIST_repos(self, request_method): request_method.return_value = mock_response_result() self.sg.list_repos().all() self.assertEqual(request_method.call_args[0], ('get', _('user/starred')))
def test_LIST_by_issue(self, request_method): request_method.return_value = mock_response_result() self.ev.list_by_issue(1).all() self.assertEqual(request_method.call_args[0], ('get', _('repos/octocat/Hello-World/issues/1/events')))
def test_LIST_with_user_in_service(self, request_method): request_method.return_value = mock_response_result() self.rs.list().all() self.assertEqual(request_method.call_args[0], ('get', _('users/octocat/repos')))
def test_LIST_with_user(self, request_method): request_method.return_value = mock_response_result() self.org.list('octocat').all() self.assertEqual(request_method.call_args[0], ('get', _('users/octocat/orgs')))
def test_LIST_contributors_with_anonymous(self, request_method): request_method.return_value = mock_response_result() self.rs.list_contributors_with_anonymous().all() self.assertEqual(request_method.call_args[0], ('get', _('repos/octocat/octocat_repo/contributors'))) self.assertEqual(request_method.call_args[1]['params']['anom'], True)