Пример #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')
Пример #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')
Пример #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'))
     )
Пример #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')
Пример #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'))
     )
Пример #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'))
     )
Пример #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')
Пример #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')))
Пример #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')))
Пример #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')))
Пример #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')))
Пример #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')))
Пример #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')))
Пример #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')))
Пример #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')))
Пример #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')))
Пример #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')))
Пример #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')))
Пример #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')))
Пример #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')))
Пример #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')))
Пример #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')))
Пример #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')))
Пример #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')))
Пример #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')))
Пример #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')))
Пример #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')))
Пример #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')))
Пример #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')))
Пример #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')))
Пример #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')))
Пример #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')))
Пример #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')))
Пример #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')))
Пример #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')))
Пример #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')))
Пример #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')))
Пример #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')))
Пример #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')))
Пример #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')))
Пример #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')))
Пример #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')))
Пример #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')))
Пример #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')))
Пример #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')))
Пример #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')))
Пример #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')))
Пример #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')))
Пример #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')))
Пример #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')))
Пример #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')))
Пример #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')))
Пример #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')))
Пример #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')))
Пример #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')))
Пример #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')))
Пример #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')))
Пример #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)
Пример #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')))
Пример #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')))