Skip to content
This repository
Browse code

More test coverage.

  • Loading branch information...
commit c2bf97faca4e01ee6c6fae2590775760189a93aa 1 parent 1d632da
Ian Cordasco authored

Showing 2 changed files with 31 additions and 4 deletions. Show diff stats Hide diff stats

  1. +1 4 github3/repos.py
  2. +30 0 tests/test_repos.py
5 github3/repos.py
@@ -1111,14 +1111,11 @@ def iter_issues(self,
1111 1111 :type since: int
1112 1112 :returns: list of :class:`Issue <github3.issues.Issue>`\ s
1113 1113 """
1114   - # Paginate
1115 1114 url = self._build_url('issues', base_url=self._api)
1116 1115
1117 1116 params = {}
1118 1117 if milestone in ('*', 'none') or isinstance(milestone, int):
1119   - params['milestone'] = str(milestone).lower()
1120   - # str(None) = 'None' which is invalid, so .lower() it to make it
1121   - # work.
  1118 + params['milestone'] = milestone
1122 1119
1123 1120 if assignee:
1124 1121 params['assignee'] = assignee
30 tests/test_repos.py
@@ -207,6 +207,9 @@ def test_list_comments(self):
207 207 return
208 208 self.fail('No commenter with login kennethreitz')
209 209
  210 + def test_iter_comments(self):
  211 + expect(next(self.repo.iter_comments())).isinstance(RepoComment)
  212 +
210 213 def test_list_comments_on_commit(self):
211 214 comments = self.requests_repo.list_comments_on_commit(
212 215 '10280c697dcfd3d334f1c9c381a11c324bb550bc')
@@ -216,12 +219,24 @@ def test_list_comments_on_commit(self):
216 219 return
217 220 self.fail('No commenter with login brunobord')
218 221
  222 + def test_iter_comments_on_commit(self):
  223 + comment = next(self.requests_repo.iter_comments_on_commit(
  224 + '10280c697dcfd3d334f1c9c381a11c324bb550bc'
  225 + ))
  226 + expect(comment).isinstance(RepoComment)
  227 +
219 228 def test_list_commits(self):
220 229 expect(self.repo.list_commits()).list_of(RepoCommit)
221 230
  231 + def test_iter_commits(self):
  232 + expect(next(self.repo.iter_commits())).isinstance(RepoCommit)
  233 +
222 234 def test_list_contributors(self):
223 235 expect(self.repo.list_contributors()).list_of(User)
224 236
  237 + def test_iter_contributors(self):
  238 + expect(next(self.repo.iter_contributors())).isinstance(User)
  239 +
225 240 def test_list_downloads(self):
226 241 downloads = self.repo.list_downloads()
227 242 expect(downloads).list_of(Download)
@@ -230,13 +245,28 @@ def test_list_downloads(self):
230 245 return
231 246 self.fail('No download with name todo.txt-python-0.3.zip')
232 247
  248 + def test_iter_downloads(self):
  249 + expect(next(self.repo.iter_downloads())).isinstance(Download)
  250 +
233 251 def test_list_events(self):
234 252 expect(self.repo.list_events()).list_of(Event)
235 253
  254 + def test_iter_events(self):
  255 + expect(next(self.repo.iter_events())).isinstance(Event)
  256 +
236 257 def test_list_forks(self):
237 258 expect(self.repo.list_forks()).list_of(Repository)
238 259 expect(self.repo.list_forks('oldest')).list_of(Repository)
239 260
  261 + def test_iter_forks(self):
  262 + expect(next(self.repo.list_forks())).isinstance(Repository)
  263 + expect(next(self.repo.list_forks('oldest'))).isinstance(Repository)
  264 +
  265 + def test_iter_issues(self):
  266 + expect(next(self.repo.iter_issues())).isinstance(Issue)
  267 + expect(next(self.requests_repo.iter_issues(milestone='*'))).isinstance(
  268 + Issue)
  269 +
240 270 def test_list_issues(self):
241 271 expect(self.repo.list_issues()).list_of(Issue)
242 272

0 comments on commit c2bf97f

Please sign in to comment.
Something went wrong with that request. Please try again.