diff options
Diffstat (limited to 'tests/test_timeline.py')
-rw-r--r-- | tests/test_timeline.py | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/tests/test_timeline.py b/tests/test_timeline.py new file mode 100644 index 0000000..0306391 --- /dev/null +++ b/tests/test_timeline.py | |||
@@ -0,0 +1,30 @@ | |||
1 | import pytest | ||
2 | |||
3 | @pytest.mark.vcr() | ||
4 | def test_public_tl_anonymous(mastodon_anonymous, status): | ||
5 | tl = mastodon_anonymous.timeline_public() | ||
6 | assert status['id'] in map(lambda st: st['id'], tl) | ||
7 | # although tempting, we can't do | ||
8 | # assert status in tl | ||
9 | # because the statuses returned in the tl have additional | ||
10 | # pagination-related attributes | ||
11 | |||
12 | @pytest.mark.vcr() | ||
13 | def test_public_tl(mastodon, status): | ||
14 | tl = mastodon.timeline_public() | ||
15 | print(tl[0]) | ||
16 | assert status['id'] in map(lambda st: st['id'], tl) | ||
17 | |||
18 | @pytest.mark.vcr() | ||
19 | def test_home_tl(mastodon, status): | ||
20 | tl = mastodon.timeline_home() | ||
21 | assert status['id'] in map(lambda st: st['id'], tl) | ||
22 | |||
23 | @pytest.mark.vcr() | ||
24 | def test_hashtag_tl(mastodon): | ||
25 | status = mastodon.status_post('#hoot (hashtag toot)') | ||
26 | tl = mastodon.timeline_hashtag('hoot') | ||
27 | try: | ||
28 | assert status['id'] in map(lambda st: st['id'], tl) | ||
29 | finally: | ||
30 | mastodon.status_delete(status['id']) | ||