From d76c26e4b9f3975a3f0d87db9f73db2188940767 Mon Sep 17 00:00:00 2001 From: codl Date: Wed, 29 Nov 2017 22:34:13 +0100 Subject: [PATCH] add test for throwing when requesting a hashtag tl with a leading hash --- tests/test_timeline.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tests/test_timeline.py b/tests/test_timeline.py index d713fca..6a27be3 100644 --- a/tests/test_timeline.py +++ b/tests/test_timeline.py @@ -1,4 +1,5 @@ import pytest +from mastodon.Mastodon import MastodonAPIError, MastodonIllegalArgumentError @pytest.mark.vcr() def test_public_tl_anonymous(api_anonymous, status): @@ -30,8 +31,12 @@ def test_hashtag_tl(api): finally: api.status_delete(status['id']) +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): - from mastodon.Mastodon import MastodonAPIError with pytest.raises(MastodonAPIError): - tl = api_anonymous.timeline_home() + api_anonymous.timeline_home()