From 3ed1cf73999ceef24ea3bf8395855bdde3876573 Mon Sep 17 00:00:00 2001 From: halcy Date: Thu, 17 Nov 2022 20:34:10 +0200 Subject: add another test for scheduled statuses --- tests/test_status.py | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'tests/test_status.py') diff --git a/tests/test_status.py b/tests/test_status.py index 764cd24..91b07fb 100644 --- a/tests/test_status.py +++ b/tests/test_status.py @@ -3,6 +3,7 @@ from mastodon.Mastodon import MastodonAPIError, MastodonNotFoundError import datetime import pytz import vcr +import time @pytest.mark.vcr() def test_status(status, api): @@ -170,3 +171,11 @@ def test_scheduled_status(api): api.scheduled_status_delete(scheduled_toot_2) scheduled_toot_list_2 = api.scheduled_statuses() assert not scheduled_toot_2.id in map(lambda x: x.id, scheduled_toot_list_2) + + the_very_immediate_future = datetime.datetime.now() + datetime.timedelta(seconds=5) + scheduled_toot_4 = api.status_post("please ensure adequate headroom", scheduled_at=the_very_immediate_future) + time.sleep(15) + statuses = api.timeline_home() + scheduled_toot_list_3 = api.scheduled_statuses() + assert scheduled_toot_4.id in map(lambda x: x.id, statuses) + assert not scheduled_toot_4.id in map(lambda x: x.id, scheduled_toot_list_3) -- cgit v1.2.3