8000 100% coverage for notifications · davidmoss/github3.py@d35587b · GitHub
[go: up one dir, main page]

Skip to content
8000

Commit d35587b

Browse files
committed
100% coverage for notifications
1 parent a3a8af9 commit d35587b

File tree

3 files changed

+11
-6
lines changed

3 files changed

+11
-6
lines changed

github3/notifications.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -99,20 +99,20 @@ def __init__(self, sub, session=None):
9999
self.thread_url = sub.get('thread_url')
100100
#: API url of the repository if it exists
101101
self.repository_url = sub.get('repository_url')
102-
self._ignored = sub.get('ignored', False)
103-
self._subscribed = sub.get('subscribed', False)
102+
self.ignored = sub.get('ignored', False)
103+
self.subscribed = sub.get('subscribed', False)
104104

105105
def __repr__(self):
106-
return '<Subscription [{0}]>'.format(self._subscribed)
106+
return '<Subscription [{0}]>'.format(self.subscribed)
107107

108108
def delete(self):
109109
return self._boolean(self._delete(self._api), 204, 404)
110110

111111
def is_ignored(self):
112-
return self._ignored
112+
return self.ignored
113113

114114
def is_subscribed(self):
115-
return self._subscribed
115+
return self.subscribed
116116

117117
def set(self, subscribed, ignored):
118118
"""Set the user's subscription for this subscription

github3/pulls.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,12 @@ def __init__(self, pull, session=None):
130130
# If the pull request has been merged
131131
if self.merged_at:
132132
self.merged_at = self._strptime(self.merged_at)
133+
#: Whether the pull is deemed mergeable by GitHub
133134
self.mergeable = pull.get('mergeable', False)
135+
#: Whether it would be a clelan merge or not
136+
self.mergeable_state = pull.get('mergeable_state', '')
137+
#: SHA of the merge commit
138+
self.merge_commit_sha = pull.get('merge_commit_sha', '')
134139
#: :class:`User <github3.users.User>` who merged this pull
135140
self.merged_by = pull.get('merged_by')
136141
if self.merged_by:

tests/json/subscription

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"ignored": false, "subscribed": true, "url": "https://api.github.com/repos/sigmavirus24/github3.py/subscription", "created_at": "2008-04-10T00:00:00Z", "reason": null, "repository_url": "https://api.github.com/repos/sigmavirus24/github3.py"}
1+
{"ignored": false, "subscribed": true, "url": "https://api.github.com/notifications/threads/5864188/subscription", "created_at": "2013-02-12T04:43:09Z", "reason": "comment", "thread_url": "https://api.github.com/notifications/threads/5864188"}

0 commit comments

Comments
 (0)
0