|
4 | 4 | from datetime import datetime
|
5 | 5 | from os import unlink
|
6 | 6 | 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 |
10 | 10 | from github3.issues import (Issue, Label, Milestone)
|
11 | 11 | from github3.events import Event
|
| 12 | +from github3.pulls import PullRequest |
12 | 13 |
|
13 | 14 |
|
14 | 15 | class TestRepository(base.BaseTest):
|
@@ -79,8 +80,18 @@ def test_methods(self):
|
79 | 80 | self.expect_list_of_class(comments, RepoComment)
|
80 | 81 | self.expect_list_of_class(repo.list_commits(), RepoCommit)
|
81 | 82 | 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) |
83 | 84 | 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 |
84 | 95 |
|
85 | 96 | def test_requires_auth(self):
|
86 | 97 | repo = self.repo
|
@@ -114,3 +125,14 @@ def test_requires_auth(self):
|
114 | 125 | repo.edit('todo.py', '#', 'http://git.io/todo.py')
|
115 | 126 | repo.hook(74859)
|
116 | 127 | 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