blob: 0306391f0a1df6906b3379805765fb24b5ef3e2b (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
import pytest
@pytest.mark.vcr()
def test_public_tl_anonymous(mastodon_anonymous, status):
tl = mastodon_anonymous.timeline_public()
assert status['id'] in map(lambda st: st['id'], tl)
# although tempting, we can't do
# assert status in tl
# because the statuses returned in the tl have additional
# pagination-related attributes
@pytest.mark.vcr()
def test_public_tl(mastodon, status):
tl = mastodon.timeline_public()
print(tl[0])
assert status['id'] in map(lambda st: st['id'], tl)
@pytest.mark.vcr()
def test_home_tl(mastodon, status):
tl = mastodon.timeline_home()
assert status['id'] in map(lambda st: st['id'], tl)
@pytest.mark.vcr()
def test_hashtag_tl(mastodon):
status = mastodon.status_post('#hoot (hashtag toot)')
tl = mastodon.timeline_hashtag('hoot')
try:
assert status['id'] in map(lambda st: st['id'], tl)
finally:
mastodon.status_delete(status['id'])
|