8000 A few more tests. · jsullivanlive/github3.py@0500d5f · GitHub
[go: up one dir, main page]

Skip to 65F9 content

Commit 0500d5f

Browse files
committed
A few more tests.
1 parent 99d6048 commit 0500d5f

File tree

2 files changed

+27
-4
lines changed

2 files changed

+27
-4
lines changed

github3/repos.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -976,6 +976,7 @@ def list_issue_events(self):
976976
json = self._json(self._get(url), 200)
977977
return [Event(e, self) for e in json]
978978

979+
@GitHubCore.requires_auth
979980
def list_keys(self):
980981
"""List deploy keys on this repository.
981982

tests/test_repos.py

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,12 @@
44
from datetime import datetime
55
from os import unlink
66
from github3.repos import (Repository, Branch, RepoCommit, RepoComment,
7-
Comparison, Contents, Download)
8-
from github3.users import User
9-
from github3.git import Commit
7+
Comparison, Contents, Download, Hook, RepoTag)
8+
from github3.users import User, Key
9+
from github3.git import Commit, Reference
1010
from github3.issues import (Issue, Label, Milestone)
1111
from github3.events import Event
12+
from github3.pulls import PullRequest
1213

1314

1415
class TestRepository(base.BaseTest):
@@ -79,8 +80,18 @@ def test_methods(self):
7980
self.expect_list_of_class(comments, RepoComment)
8081
self.expect_list_of_class(repo.list_commits(), RepoCommit)
8182
self.expect_list_of_class(repo.list_downloads(), Download)
82-
self.expect_list_of_class(repo.list_downloads(), Event)
83+
self.expect_list_of_class(repo.list_events(), Event)
8384
self.expect_list_of_class(repo.list_forks(), Repository)
85+
self.expect_list_of_class(repo.list_issues(), Issue)
86+
self.expect_list_of_class(repo.list_issue_events(), Event)
87+
self.expect_list_of_class(repo.list_milestones(), Milestone)
88+
self.expect_list_of_class(repo.list_network_events(), Event)
89+
self.expect_list_of_class(repo.list_pulls(state='closed'),
90+
PullRequest)
91+
self.expect_list_of_class(repo.list_refs(), Reference)
92+
self.expect_list_of_class(repo.list_tags(), RepoTag)
93+
self.expect_list_of_class(repo.list_watchers(), User)
94+
# XXX: next up list_hooks() -> requires_auth
8495

8596
def test_requires_auth(self):
8697
repo = self.repo
@@ -114,3 +125,14 @@ def test_requires_auth(self):
114125
repo.edit('todo.py', '#', 'http://git.io/todo.py')
115126
repo.hook(74859)
116127
repo.key(1234)
128+
repo.list_keys()
129+
repo.list_teams()
130+
131+
if self.auth:
132+
repo = self._g.repository(self.sigm, self.todo)
133+
# Try somethings only I can test
134+
try:
135+
expect(repo.hook(74859)).isinstance(Hook)
136+
expect(repo.key(3069618)).isinstance(Key)
137+
except github3.GitHubError:
138+
pass

0 commit comments

Comments
 (0)
0