aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhalcy <halcy@ARARAGI-KUN>2022-11-24 01:53:34 +0200
committerhalcy <halcy@ARARAGI-KUN>2022-11-24 01:53:34 +0200
commitf81978a39c7ad2124951806cd66fcbadffc16d59 (patch)
treed55551512f179b15f8a96e114d537663a322b7a3 /tests/test_notifications.py
parent066d543109496c732f6c05bfbe3418d30b648f42 (diff)
downloadmastodon.py-f81978a39c7ad2124951806cd66fcbadffc16d59.tar.gz
Add notification tests
Diffstat (limited to 'tests/test_notifications.py')
-rw-r--r--tests/test_notifications.py41
1 files changed, 40 insertions, 1 deletions
diff --git a/tests/test_notifications.py b/tests/test_notifications.py
index 858bad4..bdd559c 100644
--- a/tests/test_notifications.py
+++ b/tests/test_notifications.py
@@ -12,7 +12,46 @@ def mention(api2):
12def test_notifications(api, mention): 12def test_notifications(api, mention):
13 time.sleep(3) 13 time.sleep(3)
14 notifications = api.notifications() 14 notifications = api.notifications()
15 api.notifications(notifications[0]) 15 assert api.notifications(notifications[0])
16 assert notifications[0].status.id == mention.id
17
18@pytest.mark.vcr()
19def test_notifications_mentions_only(api, mention):
20 time.sleep(3)
21 notifications = api.notifications(mentions_only=True)
22 assert api.notifications(notifications[0])
23 assert notifications[0].status.id == mention.id
24
25@pytest.mark.vcr()
26def test_notifications_exclude_types(api, mention):
27 time.sleep(3)
28 notifications = api.notifications(exclude_types=["mention"])
29 if len(notifications) > 0:
30 assert notifications[0].status.id == mention.id
31
32@pytest.mark.vcr()
33def test_notifications_types(api, mention):
34 time.sleep(3)
35 notifications = api.notifications(types=["follow_request"])
36 if len(notifications) > 0:
37 assert notifications[0].status.id == mention.id
38 notifications = api.notifications(types=["follow", "mention"])
39 assert api.notifications(notifications[0])
40 assert notifications[0].status.id == mention.id
41
42@pytest.mark.vcr()
43def test_notifications_exclude_and_types(api, mention):
44 time.sleep(3)
45 notifications = api.notifications(exclude_types=["mention"], types=["mention"])
46 if len(notifications) > 0:
47 assert notifications[0].status.id == mention.id
48 notifications = api.notifications(exclude_types=["mention"], types=["follow_request"])
49 if len(notifications) > 0:
50 assert notifications[0].status.id == mention.id
51 notifications = api.notifications(exclude_types=["follow_request"], types=["mention"])
52 assert notifications[0].status.id == mention.id
53 notifications = api.notifications(exclude_types=["follow_request"], types=["mention", "follow_request"])
54 assert notifications[0].status.id == mention.id
16 55
17@pytest.mark.vcr() 56@pytest.mark.vcr()
18def test_notifications_dismiss(api, mention): 57def test_notifications_dismiss(api, mention):
Powered by cgit v1.2.3 (git 2.41.0)