add test for throwing when requesting a hashtag tl with a leading hash

This commit is contained in:
codl 2017-11-29 22:34:13 +01:00
pare 309cc26ded
commit d76c26e4b9
No se encontró ninguna clave conocida en la base de datos para esta firma
ID de clave GPG: 6CD7C8891ED1233A

Veure arxiu

@ -1,4 +1,5 @@
import pytest import pytest
from mastodon.Mastodon import MastodonAPIError, MastodonIllegalArgumentError
@pytest.mark.vcr() @pytest.mark.vcr()
def test_public_tl_anonymous(api_anonymous, status): def test_public_tl_anonymous(api_anonymous, status):
@ -30,8 +31,12 @@ def test_hashtag_tl(api):
finally: finally:
api.status_delete(status['id']) api.status_delete(status['id'])
def test_hashtag_tl_leading_hash(api):
with pytest.raises(MastodonIllegalArgumentError):
api.timeline_hashtag('#hoot')
@pytest.mark.vcr() @pytest.mark.vcr()
def test_home_tl_anonymous_throws(api_anonymous): def test_home_tl_anonymous_throws(api_anonymous):
from mastodon.Mastodon import MastodonAPIError
with pytest.raises(MastodonAPIError): with pytest.raises(MastodonAPIError):
tl = api_anonymous.timeline_home() api_anonymous.timeline_home()