From 06df1c281eb0825ec9f646960f4d9426eba7e081 Mon Sep 17 00:00:00 2001 From: Lorenz Diener Date: Sun, 28 Apr 2019 13:47:43 +0200 Subject: Add conversation fetching --- tests/test_timeline.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'tests/test_timeline.py') diff --git a/tests/test_timeline.py b/tests/test_timeline.py index 4e77ff7..3a75029 100644 --- a/tests/test_timeline.py +++ b/tests/test_timeline.py @@ -1,4 +1,5 @@ import pytest +import time from mastodon.Mastodon import MastodonAPIError,\ MastodonIllegalArgumentError,\ MastodonUnauthorizedError @@ -38,8 +39,19 @@ def test_hashtag_tl_leading_hash(api): with pytest.raises(MastodonIllegalArgumentError): api.timeline_hashtag('#hoot') - @pytest.mark.vcr() def test_home_tl_anonymous_throws(api_anonymous): with pytest.raises(MastodonAPIError): api_anonymous.timeline_home() + +@pytest.mark.vcr() +def test_conversations(api, api2): + account = api.account_verify_credentials() + status = api.status_post("@admin ilu bby ;3", visibility="direct") + time.sleep(2) + conversations = api2.conversations() + api.status_delete(status) + assert conversations + assert status.id in map(lambda x: x.last_status.id, conversations) + assert account.id in map(lambda x: x.accounts[0].id, conversations) + -- cgit v1.2.3