8000 Added set subscription test · pythonthings/github3.py@64d219d · GitHub
[go: up one dir, main page]

Skip to content

Commit 64d219d

Browse files
Added set subscription test
1 parent bc95a2c commit 64d219d

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

tests/unit/test_notifications.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,23 @@ def test_repr(self):
2626
self.instance.subject.get('title'))
2727

2828
def test_delete_description(self):
29+
"""Show that a user can delete a subscription"""
2930
self.instance.delete_subscription()
3031

3132
self.session.delete.assert_called_once_with(url_for('subscription'))
33+
34+
def test_mark(self):
35+
"""Show that a user can mark the subscription"""
36+
self.instance.mark()
37+
38+
assert self.session.patch.called
39+
40+
def test_set_subscription(self):
41+
"""Show that a user can subscribe to nofication"""
42+
43+
self.instance.set_subscription(True, False)
44+
45+
self.session.put.assert_called_once_with(
46+
url_for('subscription'),
47+
data='{"ignored": false, "subscribed": true}'
48+
)

0 commit comments

Comments
 (0)
0