Ejemplo n.º 1
0
 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')
Ejemplo n.º 2
0
 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')
Ejemplo n.º 3
0
 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'))
     )
Ejemplo n.º 4
0
 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')
Ejemplo n.º 5
0
 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'))
     )
Ejemplo n.º 6
0
 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'))
     )
Ejemplo n.º 7
0
 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')
Ejemplo n.º 8
0
 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')))
Ejemplo n.º 9
0
 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')))
Ejemplo n.º 10
0
 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')))
Ejemplo n.º 11
0
 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')))
Ejemplo n.º 12
0
 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')))
Ejemplo n.º 13
0
 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')))
Ejemplo n.º 14
0
 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')))
Ejemplo n.º 15
0
 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')))
Ejemplo n.º 16
0
 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')))
Ejemplo n.º 17
0
 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')))
Ejemplo n.º 18
0
 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')))
Ejemplo n.º 19
0
 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')))
Ejemplo n.º 20
0
 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')))
Ejemplo n.º 21
0
 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')))
Ejemplo n.º 22
0
 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')))
Ejemplo n.º 23
0
 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')))
Ejemplo n.º 24
0
 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')))
Ejemplo n.º 25
0
 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')))
Ejemplo n.º 26
0
 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')))
Ejemplo n.º 27
0
 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')))
Ejemplo n.º 28
0
 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')))
Ejemplo n.º 29
0
 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')))
Ejemplo n.º 30
0
 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')))
Ejemplo n.º 31
0
 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')))
Ejemplo n.º 32
0
 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')))
Ejemplo n.º 33
0
 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')))
Ejemplo n.º 34
0
 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')))
Ejemplo n.º 35
0
 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')))
Ejemplo n.º 36
0
 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')))
Ejemplo n.º 37
0
 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')))
Ejemplo n.º 38
0
 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')))
Ejemplo n.º 39
0
 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')))
Ejemplo n.º 40
0
 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')))
Ejemplo n.º 41
0
 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')))
Ejemplo n.º 42
0
 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')))
Ejemplo n.º 43
0
 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')))
Ejemplo n.º 44
0
 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')))
Ejemplo n.º 45
0
 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')))
Ejemplo n.º 46
0
 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')))
Ejemplo n.º 47
0
 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')))
Ejemplo n.º 48
0
 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')))
Ejemplo n.º 49
0
 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')))
Ejemplo n.º 50
0
 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')))
Ejemplo n.º 51
0
 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')))
Ejemplo n.º 52
0
 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')))
Ejemplo n.º 53
0
 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')))
Ejemplo n.º 54
0
 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')))
Ejemplo n.º 55
0
 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')))
Ejemplo n.º 56
0
 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')))
Ejemplo n.º 57
0
 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')))
Ejemplo n.º 58
0
 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)
Ejemplo n.º 59
0
 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')))
Ejemplo n.º 60
0
 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')))