8000 Fix up GitHub#all_events integration test · osnr/github3.py@bb8cbaf · GitHub
[go: up one dir, main page]

Skip to content

Commit bb8cbaf

Browse files
committed
Fix up GitHub#all_events integration test
1 parent e098c81 commit bb8cbaf

File tree

2 files changed

+19
-9
lines changed

2 files changed

+19
-9
lines changed

github3/issues/comment.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# -*- coding: utf-8 -*-
22
from __future__ import unicode_literals
33

4+
from .. import users
45
from ..utils import timestamp_parameter
56
from ..models import BaseComment
6-
from ..users import User
77

88

99
class IssueComment(BaseComment):
@@ -26,7 +26,9 @@ def _update_attributes(self, comment):
2626
super(IssueComment, self)._update_attributes(comment)
2727

2828
#: :class:`User <github3.users.User>` who made the comment
29-
self.user = self._class_attribute(comment, 'user', User, self)
29+
self.user = self._class_attribute(
30+
comment, 'user', users.ShortUser, self,
31+
)
3032

3133
#: Issue url (not a template)
3234
self.issue_url = self._get_attribute(comment, 'issue_url')

github3/pulls.py

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@
1313
from uritemplate import URITemplate
1414

1515
from . import models
16+
from . import users
1617
from .decorators import requires_auth
1718
from .issues import Issue
1819
from .issues.comment import IssueComment
1920
from .repos.commit import RepoCommit
2021
from .repos.contents import Contents
21-
from .users import User
2222

2323

2424
class PullDestination(models.GitHubCore):
@@ -39,7 +39,7 @@ def __init__(self, dest, direction):
3939
#: :class:`User <github3.users.User>` representing the owner
4040
self.user = None
4141
if dest.get('user'):
42-
self.user = User(dest.get('user'), None)
42+
self.user = users.ShortUser(dest.get('user'), None)
4343
#: SHA of the commit at the head
4444
self.sha = dest.get('sha')
4545
self._repo_name = ''
@@ -198,7 +198,9 @@ def _update_attributes(self, pull):
198198
self.mergeable_state = self._get_attribute(pull, 'mergeable_state')
199199

200200
#: :class:`User <github3.users.User>` who merged this pull
201-
self.merged_by = self._class_attribute(pull, 'merged_by', User, self)
201+
self.merged_by = self._class_attribute(
202+
pull, 'merged_by', users.ShortUser, self,
203+
)
202204

203205
#: Number of the pull/issue on the repository
204206
self.number = self._get_attribute(pull, 'number')
@@ -237,11 +239,13 @@ def _update_attributes(self, pull):
237239

238240
#: :class:`User <github3.users.User>` object representing the creator
239241
#: of the pull request
240-
self.user = self._class_attribute(pull, 'user', User, self)
242+
self.user = self._class_attribute(pull, 'user', users.ShortUser, self)
241243

242244
#: :class:`User <github3.users.User>` object representing the assignee
243245
#: of the pull request
244-
self.assignee = self._class_attribute(pull, 'assignee', User, self)
246+
self.assignee = self._class_attribute(
247+
pull, 'assignee', users.ShortUser, self,
248+
)
245249

246250
def _repr(self):
247251
return '<Pull Request [#{0}]>'.format(self.number)
@@ -460,7 +464,9 @@ def _update_attributes(self, preview):
460464
self.commit_id = self._get_attribute(preview, 'commit_id')
461465

462466
#: :class:`User <github3.users.User>` who made the comment
463-
self.user = self._class_attribute(preview, 'user', User, self)
467+
self.user = self._class_attribute(
468+
preview, 'user', users.ShortUser, self,
469+
)
464470

465471
#: State of the review
466472
self.state = self._get_attribute(preview, 'state')
@@ -502,7 +508,9 @@ class ReviewComment(models.BaseComment):
502508
def _update_attributes(self, comment):
503509
super(ReviewComment, self)._update_attributes(comment)
504510
#: :class:`User <github3.users.User>` who made the comment
505-
self.user = self._class_attribute(comment, 'user', User, self)
511+
self.user = self._class_attribute(
512+
comment, 'user', users.ShortUser, self,
513+
)
506514

507515
#: Original position inside the file
508516
self.original_position = self._get_attribute(

0 commit comments

Comments
 (0)
0