diff options
author | Lorenz Diener <[email protected]> | 2018-05-06 15:55:32 +0200 |
---|---|---|
committer | GitHub <[email protected]> | 2018-05-06 15:55:32 +0200 |
commit | ca0ea36c6edd58dc15e5fd7f31f24ba5097d6e8d (patch) | |
tree | 98328e8776447334b19592992016d9b7f16ae98b /tests/test_instance.py | |
parent | 06e32c14bcb5a1ef1a5e618a1b413ea011416c9d (diff) | |
parent | fbd4122fec092bff6b1cc9f44dfeda6ee693c41b (diff) | |
download | mastodon.py-ca0ea36c6edd58dc15e5fd7f31f24ba5097d6e8d.tar.gz |
Merge branch 'master' into stream-timeout
Diffstat (limited to 'tests/test_instance.py')
-rw-r--r-- | tests/test_instance.py | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/test_instance.py b/tests/test_instance.py index 7b6dc49..199e654 100644 --- a/tests/test_instance.py +++ b/tests/test_instance.py | |||
@@ -1,5 +1,7 @@ | |||
1 | import pytest | 1 | import pytest |
2 | 2 | ||
3 | from mastodon.Mastodon import MastodonVersionError | ||
4 | |||
3 | @pytest.mark.vcr() | 5 | @pytest.mark.vcr() |
4 | def test_instance(api): | 6 | def test_instance(api): |
5 | instance = api.instance() | 7 | instance = api.instance() |
@@ -8,3 +10,25 @@ def test_instance(api): | |||
8 | 10 | ||
9 | expected_keys = set(('description', 'email', 'title', 'uri', 'version', 'urls')) | 11 | expected_keys = set(('description', 'email', 'title', 'uri', 'version', 'urls')) |
10 | assert set(instance.keys()) >= expected_keys | 12 | assert set(instance.keys()) >= expected_keys |
13 | |||
14 | @pytest.mark.vcr() | ||
15 | def test_instance_activity(api): | ||
16 | activity = api.instance_activity() | ||
17 | |||
18 | assert len(activity) > 0 | ||
19 | assert "statuses" in activity[0] | ||
20 | assert "logins" in activity[0] | ||
21 | assert "week" in activity[0] | ||
22 | |||
23 | @pytest.mark.vcr() | ||
24 | def test_instance_peers(api): | ||
25 | assert len(api.instance_peers()) == 0 | ||
26 | |||
27 | @pytest.mark.vcr() | ||
28 | def test_low_version(api_low_version): | ||
29 | with pytest.raises(MastodonVersionError): | ||
30 | instance = api_low_version.instance() | ||
31 | |||
32 | @pytest.mark.vcr() | ||
33 | def test_emoji(api): | ||
34 | assert len(api.custom_emojis()) == 0 \ No newline at end of file | ||