From 56e6bac9cb19101346cb42b73628290740889ecf Mon Sep 17 00:00:00 2001 From: codl Date: Wed, 3 Jan 2018 11:44:14 +0100 Subject: update tests --- tests/test_timeline.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'tests/test_timeline.py') diff --git a/tests/test_timeline.py b/tests/test_timeline.py index 6a27be3..5108b63 100644 --- a/tests/test_timeline.py +++ b/tests/test_timeline.py @@ -1,5 +1,7 @@ import pytest -from mastodon.Mastodon import MastodonAPIError, MastodonIllegalArgumentError +from mastodon.Mastodon import MastodonAPIError,\ + MastodonIllegalArgumentError,\ + MastodonUnauthorizedError @pytest.mark.vcr() def test_public_tl_anonymous(api_anonymous, status): @@ -17,6 +19,11 @@ def test_public_tl(api, status): assert status['id'] in map(lambda st: st['id'], public) assert status['id'] in map(lambda st: st['id'], local) +@pytest.mark.vcr() +def test_unauthed_home_tl_throws(api_anonymous, status): + with pytest.raises(MastodonUnauthorizedError): + api_anonymous.timeline_home() + @pytest.mark.vcr() def test_home_tl(api, status): tl = api.timeline_home() -- cgit v1.2.3