8000 Fix equality for IssueEvents without a commit. · aroig/github3.py@862904d · GitHub
[go: up one dir, main page]

Skip to content

Commit 862904d

Browse files
committed
Fix equality for IssueEvents without a commit.
1 parent 59df554 commit 862904d

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

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(

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