diff options
author | halcy <halcy@ARARAGI-KUN> | 2022-11-17 23:51:40 +0200 |
---|---|---|
committer | halcy <halcy@ARARAGI-KUN> | 2022-11-17 23:51:40 +0200 |
commit | c35104748dac99ee4777cfa057c1afa65ed2a117 (patch) | |
tree | cfe1a838a8a98f004164b2d3ef0cce1c8cf56142 /tests/test_timeline.py | |
parent | 897b3a23cf4177675f0769de68f08ad8c4faf335 (diff) | |
download | mastodon.py-c35104748dac99ee4777cfa057c1afa65ed2a117.tar.gz |
maybe fix tests
Diffstat (limited to 'tests/test_timeline.py')
-rw-r--r-- | tests/test_timeline.py | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/tests/test_timeline.py b/tests/test_timeline.py index 9d63025..85026f6 100644 --- a/tests/test_timeline.py +++ b/tests/test_timeline.py | |||
@@ -81,12 +81,19 @@ def test_min_max_id(api, status): | |||
81 | @pytest.mark.vcr() | 81 | @pytest.mark.vcr() |
82 | def test_min_max_id_datetimes(api, status): | 82 | def test_min_max_id_datetimes(api, status): |
83 | if os.path.exists("tests/cassettes/test_min_max_id_datetimes_datetimeobjects.pkl"): | 83 | if os.path.exists("tests/cassettes/test_min_max_id_datetimes_datetimeobjects.pkl"): |
84 | the_past, the_future, the_far_future = pickle.load(open("tests/cassettes/test_min_max_id_datetimes_datetimeobjects.pkl", 'rb')) | 84 | data_dict = pickle.load(open("tests/cassettes/test_min_max_id_datetimes_datetimeobjects.pkl", 'rb')) |
85 | the_past = data_dict["the_past"] | ||
86 | the_future = data_dict["the_future"] | ||
87 | the_far_future = data_dict["the_far_future"] | ||
85 | else: | 88 | else: |
86 | the_past = datetime.datetime.now() - datetime.timedelta(seconds=20) | 89 | the_past = datetime.datetime.now() - datetime.timedelta(seconds=20) |
87 | the_future = datetime.datetime.now() + datetime.timedelta(seconds=20) | 90 | the_future = datetime.datetime.now() + datetime.timedelta(seconds=20) |
88 | the_far_future = datetime.datetime.now() + datetime.timedelta(seconds=40) | 91 | the_far_future = datetime.datetime.now() + datetime.timedelta(seconds=40) |
89 | pickle.dump((the_past, the_future, the_far_future), open("tests/cassettes/test_min_max_id_datetimes_datetimeobjects.pkl", 'wb')) | 92 | pickle.dump({ |
93 | "the_past": the_past, | ||
94 | "the_future": the_future, | ||
95 | "the_far_future": the_far_future, | ||
96 | }, open("tests/cassettes/test_min_max_id_datetimes_datetimeobjects.pkl", 'wb')) | ||
90 | 97 | ||
91 | time.sleep(3) | 98 | time.sleep(3) |
92 | tl = api.timeline_home(min_id = the_past, max_id = the_future) | 99 | tl = api.timeline_home(min_id = the_past, max_id = the_future) |