From d09d27cdd25a6277333b65953d546bd281e380da Mon Sep 17 00:00:00 2001 From: codl Date: Mon, 27 Nov 2017 02:37:02 +0100 Subject: add a test for instance --- tests/test_instance.py | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 tests/test_instance.py (limited to 'tests/test_instance.py') diff --git a/tests/test_instance.py b/tests/test_instance.py new file mode 100644 index 0000000..d6f1bed --- /dev/null +++ b/tests/test_instance.py @@ -0,0 +1,11 @@ +from .fixtures import * +import pytest + +@pytest.mark.vcr() +def test_instance(mastodon): + instance = mastodon.instance() + + assert isinstance(instance, dict) # hehe, instance is instance + + expected_keys = set(('description', 'email', 'title', 'uri', 'version', 'urls')) + assert set(instance.keys()) >= expected_keys -- cgit v1.2.3 From 765db0fc8149aad4c103244e013fdd128af8d3d2 Mon Sep 17 00:00:00 2001 From: codl Date: Mon, 27 Nov 2017 04:22:03 +0100 Subject: move fixtures.py to standardized location conftest.py --- tests/test_instance.py | 1 - 1 file changed, 1 deletion(-) (limited to 'tests/test_instance.py') diff --git a/tests/test_instance.py b/tests/test_instance.py index d6f1bed..3ea3cf1 100644 --- a/tests/test_instance.py +++ b/tests/test_instance.py @@ -1,4 +1,3 @@ -from .fixtures import * import pytest @pytest.mark.vcr() -- cgit v1.2.3 From 304145f4420180b23e0836a6d11fc0cec0e341bd Mon Sep 17 00:00:00 2001 From: codl Date: Mon, 27 Nov 2017 14:35:02 +0100 Subject: rename mastodon and mastodon_anonymous fixtures to api, api_anonymous it was starting to get confusing --- tests/test_instance.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tests/test_instance.py') diff --git a/tests/test_instance.py b/tests/test_instance.py index 3ea3cf1..7b6dc49 100644 --- a/tests/test_instance.py +++ b/tests/test_instance.py @@ -1,8 +1,8 @@ import pytest @pytest.mark.vcr() -def test_instance(mastodon): - instance = mastodon.instance() +def test_instance(api): + instance = api.instance() assert isinstance(instance, dict) # hehe, instance is instance -- cgit v1.2.3