From f8e209f6ff70d3be08b71b05f4cec753a9dac926 Mon Sep 17 00:00:00 2001 From: Lorenz Diener Date: Sun, 6 May 2018 02:26:19 +0200 Subject: Add more tests --- tests/test_instance.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'tests/test_instance.py') diff --git a/tests/test_instance.py b/tests/test_instance.py index 7b6dc49..e8be86f 100644 --- a/tests/test_instance.py +++ b/tests/test_instance.py @@ -1,5 +1,7 @@ import pytest +from mastodon.Mastodon import MastodonVersionError + @pytest.mark.vcr() def test_instance(api): instance = api.instance() @@ -8,3 +10,22 @@ def test_instance(api): expected_keys = set(('description', 'email', 'title', 'uri', 'version', 'urls')) assert set(instance.keys()) >= expected_keys + +@pytest.mark.vcr() +def test_instance_activity(api): + activity = api.instance_activity() + + assert len(activity) > 0 + assert "statuses" in activity[0] + assert "logins" in activity[0] + assert "week" in activity[0] + +@pytest.mark.vcr() +def test_instance_peers(api): + assert len(api.instance_peers()) == 0 + +@pytest.mark.vcr() +def test_low_version(api_low_version): + with pytest.raises(MastodonVersionError): + instance = api_low_version.instance() + \ No newline at end of file -- cgit v1.2.3 From fbd4122fec092bff6b1cc9f44dfeda6ee693c41b Mon Sep 17 00:00:00 2001 From: Lorenz Diener Date: Sun, 6 May 2018 15:52:55 +0200 Subject: Add emoji test --- tests/test_instance.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'tests/test_instance.py') diff --git a/tests/test_instance.py b/tests/test_instance.py index e8be86f..199e654 100644 --- a/tests/test_instance.py +++ b/tests/test_instance.py @@ -28,4 +28,7 @@ def test_instance_peers(api): def test_low_version(api_low_version): with pytest.raises(MastodonVersionError): instance = api_low_version.instance() - \ No newline at end of file + +@pytest.mark.vcr() +def test_emoji(api): + assert len(api.custom_emojis()) == 0 \ No newline at end of file -- cgit v1.2.3