2017-11-30 02:36:43 +01:00
|
|
|
import pytest
|
2019-10-11 21:51:28 +02:00
|
|
|
import vcr
|
2017-11-30 02:36:43 +01:00
|
|
|
|
|
|
|
@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):
|
|
|
|
notifications = api.notifications()
|
|
|
|
api.notifications(notifications[0])
|
|
|
|
|
|
|
|
@pytest.mark.vcr()
|
|
|
|
def test_notifications_dismiss(api, mention):
|
|
|
|
notifications = api.notifications()
|
2019-10-11 23:59:24 +02:00
|
|
|
api.notifications_dismiss(notifications[0])
|
|
|
|
|
2019-10-11 22:43:20 +02:00
|
|
|
def test_notifications_dismiss_pre_2_9_2(api, api2):
|
2019-10-11 21:51:28 +02:00
|
|
|
with vcr.use_cassette('test_notifications_dismiss.yaml', cassette_library_dir='tests/cassettes_pre_2_9_2', record_mode='none'):
|
2019-10-11 22:43:20 +02:00
|
|
|
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)
|
2017-11-30 02:36:43 +01:00
|
|
|
|
|
|
|
@pytest.mark.vcr()
|
|
|
|
def test_notifications_clear(api):
|
|
|
|
api.notifications_clear()
|