aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_status.py')
-rw-r--r--tests/test_status.py23
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/test_status.py b/tests/test_status.py
index ad861ea..c34db0d 100644
--- a/tests/test_status.py
+++ b/tests/test_status.py
@@ -1,5 +1,6 @@
1import pytest 1import pytest
2from mastodon.Mastodon import MastodonAPIError, MastodonNotFoundError 2from mastodon.Mastodon import MastodonAPIError, MastodonNotFoundError
3import datetime
3 4
4@pytest.mark.vcr() 5@pytest.mark.vcr()
5def test_status(status, api): 6def test_status(status, api):
@@ -121,3 +122,25 @@ def test_status_pin_unpin(status, api):
121 122
122 status = api.status_unpin(status['id']) 123 status = api.status_unpin(status['id'])
123 assert not status['pinned'] 124 assert not status['pinned']
125
126@pytest.mark.vcr()
127def test_scheduled_status(api):
128 the_future = datetime.datetime.now() + datetime.timedelta(minutes=20)
129 scheduled_toot = api.status_post("please ensure adequate headroom", scheduled_at=the_future)
130 assert scheduled_toot
131
132 the_immediate_future = datetime.datetime.now() + datetime.timedelta(minutes=10)
133 scheduled_toot_2 = api.scheduled_status_update(scheduled_toot, the_immediate_future)
134 assert scheduled_toot_2
135 assert scheduled_toot_2.id == scheduled_toot.id
136 assert scheduled_toot_2.scheduled_at < scheduled_toot.scheduled_at
137
138 scheduled_toot_list = api.scheduled_statuses()
139 assert scheduled_toot_2.id in map(lambda x: x.id, scheduled_toot_list)
140
141 scheduled_toot_3 = api.scheduled_status(scheduled_toot.id)
142 assert scheduled_toot_2.id == scheduled_toot_3.id
143
144 api.scheduled_status_delete(scheduled_toot_2)
145 scheduled_toot_list_2 = api.scheduled_statuses()
146 assert not scheduled_toot_2.id in map(lambda x: x.id, scheduled_toot_list_2)
Powered by cgit v1.2.3 (git 2.41.0)