8000 Merge pull request #824 from katharosada/develop · jayhawk87/github3.py@dd156aa · GitHub
[go: up one dir, main page]

Skip to content

Commit dd156aa

Browse files
authored
Merge pull request sigmavirus24#824 from katharosada/develop
Fix equality for IssueEvents without a commit.
2 parents 59df554 + 86fc02f commit dd156aa

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

AUTHORS.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,3 +156,5 @@ Contributors
156156
- Becca James (@beccasjames)
157157

158158
- Walid Ziouche (@01walid)
159+
160+
- Katie Bell (@katharosada)

github3/issues/event.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ def _update_attributes(self, event):
8989

9090
self.event = event['event']
9191
self.id = event['id']
92-
self._uniq = self.commit_id
92+
self._uniq = self._api
9393

9494
def _repr(self):
9595
return '<Issue Event [{0} by {1}]>'.format(
< 9E5F /code>

tests/unit/test_issues_issue.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -470,7 +470,12 @@ def test_equality(self):
470470
get_issue_event_example_data(),
471471
self.session
472472
)
473+
assigned_event = github3.issues.event.IssueEvent(
474+
get_issue_assigned_event_example_data(),
475+
self.session
476+
)
473477

478+
assert self.instance._uniq is not None
479+
assert assigned_event._uniq is not None
474480
assert self.instance == issue_event
475-
issue_event._uniq = 'foo'
476-
assert self.instance != issue_event
481+
assert self.instance != assigned_event

0 commit comments

Comments
 (0)
0