diff options
author | Lorenz Diener <[email protected]> | 2018-01-29 11:18:37 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2018-01-29 11:18:37 +0100 |
commit | 42b1d8fa5895f416853311db220cf9412ad8fd13 (patch) | |
tree | cc8615955cba00aa7ba224733e3371379bbfb855 /tests/test_timeline.py | |
parent | 1d54c35101a6c349e457e7b708e29db15242a139 (diff) | |
parent | 56e6bac9cb19101346cb42b73628290740889ecf (diff) | |
download | mastodon.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.py | 9 |
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 @@ | |||
1 | import pytest | 1 | import pytest |
2 | from mastodon.Mastodon import MastodonAPIError, MastodonIllegalArgumentError | 2 | from mastodon.Mastodon import MastodonAPIError,\ |
3 | MastodonIllegalArgumentError,\ | ||
4 | MastodonUnauthorizedError | ||
3 | 5 | ||
4 | @pytest.mark.vcr() | 6 | @pytest.mark.vcr() |
5 | def test_public_tl_anonymous(api_anonymous, status): | 7 | def 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() |
23 | def test_unauthed_home_tl_throws(api_anonymous, status): | ||
24 | with pytest.raises(MastodonUnauthorizedError): | ||
25 | api_anonymous.timeline_home() | ||
26 | |||
27 | @pytest.mark.vcr() | ||
21 | def test_home_tl(api, status): | 28 | def 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) |