aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLorenz Diener <[email protected]>2018-01-29 11:18:37 +0100
committerGitHub <[email protected]>2018-01-29 11:18:37 +0100
commit42b1d8fa5895f416853311db220cf9412ad8fd13 (patch)
treecc8615955cba00aa7ba224733e3371379bbfb855 /tests/test_timeline.py
parent1d54c35101a6c349e457e7b708e29db15242a139 (diff)
parent56e6bac9cb19101346cb42b73628290740889ecf (diff)
downloadmastodon.py-42b1d8fa5895f416853311db220cf9412ad8fd13.tar.gz
Merge pull request #118 from codl/subclass-api-errors
Subclass api errors
Diffstat (limited to 'tests/test_timeline.py')
-rw-r--r--tests/test_timeline.py9
1 files changed, 8 insertions, 1 deletions
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 @@
1import pytest 1import pytest
2from mastodon.Mastodon import MastodonAPIError, MastodonIllegalArgumentError 2from mastodon.Mastodon import MastodonAPIError,\
3 MastodonIllegalArgumentError,\
4 MastodonUnauthorizedError
3 5
4@pytest.mark.vcr() 6@pytest.mark.vcr()
5def test_public_tl_anonymous(api_anonymous, status): 7def test_public_tl_anonymous(api_anonymous, status):
@@ -18,6 +20,11 @@ def test_public_tl(api, status):
18 assert status['id'] in map(lambda st: st['id'], local) 20 assert status['id'] in map(lambda st: st['id'], local)
19 21
20@pytest.mark.vcr() 22@pytest.mark.vcr()
23def test_unauthed_home_tl_throws(api_anonymous, status):
24 with pytest.raises(MastodonUnauthorizedError):
25 api_anonymous.timeline_home()
26
27@pytest.mark.vcr()
21def test_home_tl(api, status): 28def test_home_tl(api, status):
22 tl = api.timeline_home() 29 tl = api.timeline_home()
23 assert status['id'] in map(lambda st: st['id'], tl) 30 assert status['id'] in map(lambda st: st['id'], tl)
Powered by cgit v1.2.3 (git 2.41.0)