diff options
author | halcy <halcy@ARARAGI-KUN> | 2022-12-01 00:11:17 +0200 |
---|---|---|
committer | halcy <halcy@ARARAGI-KUN> | 2022-12-01 00:11:17 +0200 |
commit | a4b2b180d32a0920ac69b89a6a22d573af9e162e (patch) | |
tree | e8bdb1910f5a3cb5a413b21d3e9240035c0f3bcc /tests | |
parent | d9cd7547fd0919a46b79ede084910b7df66f8fd7 (diff) | |
download | mastodon.py-a4b2b180d32a0920ac69b89a6a22d573af9e162e.tar.gz |
More moving functions out
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_status.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/tests/test_status.py b/tests/test_status.py index 1fa7fd5..8461bc3 100644 --- a/tests/test_status.py +++ b/tests/test_status.py | |||
@@ -1,7 +1,13 @@ | |||
1 | import pytest | 1 | import pytest |
2 | from mastodon.Mastodon import MastodonAPIError, MastodonNotFoundError | 2 | from mastodon.Mastodon import MastodonAPIError, MastodonNotFoundError |
3 | import datetime | 3 | import datetime |
4 | import zoneinfo | 4 | try: |
5 | import zoneinfo | ||
6 | timezone = zoneinfo.ZoneInfo | ||
7 | except: | ||
8 | import pytz | ||
9 | timezone = pytz.timezone | ||
10 | |||
5 | import vcr | 11 | import vcr |
6 | import time | 12 | import time |
7 | import pickle | 13 | import pickle |
@@ -154,7 +160,7 @@ def test_status_pin_unpin(status, api): | |||
154 | 160 | ||
155 | @pytest.mark.vcr(match_on=['path']) | 161 | @pytest.mark.vcr(match_on=['path']) |
156 | def test_scheduled_status(api): | 162 | def test_scheduled_status(api): |
157 | base_time = datetime.datetime(4000, 1, 1, 12, 13, 14, 0, zoneinfo.ZoneInfo("Etc/GMT+2")) | 163 | base_time = datetime.datetime(4000, 1, 1, 12, 13, 14, 0, timezone("Etc/GMT+2")) |
158 | the_future = base_time + datetime.timedelta(minutes=20) | 164 | the_future = base_time + datetime.timedelta(minutes=20) |
159 | scheduled_toot = api.status_post("please ensure adequate headroom", scheduled_at=the_future) | 165 | scheduled_toot = api.status_post("please ensure adequate headroom", scheduled_at=the_future) |
160 | assert scheduled_toot | 166 | assert scheduled_toot |