From 309cc26ded4fd30f970c58d9c9f7d88b327f7c18 Mon Sep 17 00:00:00 2001 From: codl Date: Wed, 29 Nov 2017 21:42:20 +0100 Subject: add another user to the test setup --- tests/conftest.py | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) (limited to 'tests/conftest.py') diff --git a/tests/conftest.py b/tests/conftest.py index a0733b5..f6ee327 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -1,21 +1,28 @@ import pytest -@pytest.fixture -def api(): + +def _api(access_token='__MASTODON_PY_TEST_ACCESS_TOKEN'): import mastodon return mastodon.Mastodon( api_base_url='http://localhost:3000', - client_id='__MASTODON_PY_TEST_ID', - client_secret='__MASTODON_PY_TEST_SECRET', - access_token='__MASTODON_PY_TEST_TOKEN') + client_id='__MASTODON_PY_TEST_CLIENT_ID', + client_secret='__MASTODON_PY_TEST_CLIENT_SECRET', + access_token=access_token) + + +@pytest.fixture +def api(): + return _api() + + +@pytest.fixture +def api2(): + return _api(access_token='__MASTODON_PY_TEST_ACCESS_TOKEN_2') + @pytest.fixture def api_anonymous(): - import mastodon - return mastodon.Mastodon( - api_base_url='http://localhost:3000', - client_id='__MASTODON_PY_TEST_ID', - client_secret='__MASTODON_PY_TEST_SECRET') + return _api(access_token=None) @pytest.fixture() def status(api): -- cgit v1.2.3