aboutsummaryrefslogtreecommitdiff
blob: 0be81c671343c7ce16a0e1e41e8eba1c507aee59 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import pytest
import vcr
import time

@pytest.fixture()
def mention(api2):
    status = api2.status_post('@mastodonpy_test hello!')
    yield status
    api2.status_delete(status)

@pytest.mark.vcr()
def test_notifications(api, mention):
    time.sleep(3)
    notifications = api.notifications()
    api.notifications(notifications[0])

@pytest.mark.vcr()
def test_notifications_dismiss(api, mention):
    time.sleep(3)
    notifications = api.notifications()
    api.notifications_dismiss(notifications[0])
    
def test_notifications_dismiss_pre_2_9_2(api, api2):
    with vcr.use_cassette('test_notifications_dismiss.yaml', cassette_library_dir='tests/cassettes_pre_2_9_2', record_mode='none'):
        status = None
        try:
            status = api2.status_post('@mastodonpy_test hello!')
            notifications = api.notifications()
            api.notifications_dismiss(notifications[0])
        finally:
            if not status is None:
                api2.status_delete(status)            

@pytest.mark.vcr()
def test_notifications_clear(api):
    api.notifications_clear()
Powered by cgit v1.2.3 (git 2.41.0)