diff options
Diffstat (limited to 'tests/conftest.py')
-rw-r--r-- | tests/conftest.py | 27 |
1 files changed, 17 insertions, 10 deletions
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 @@ | |||
1 | import pytest | 1 | import pytest |
2 | 2 | ||
3 | @pytest.fixture | 3 | |
4 | def api(): | 4 | def _api(access_token='__MASTODON_PY_TEST_ACCESS_TOKEN'): |
5 | import mastodon | 5 | import mastodon |
6 | return mastodon.Mastodon( | 6 | return mastodon.Mastodon( |
7 | api_base_url='http://localhost:3000', | 7 | api_base_url='http://localhost:3000', |
8 | client_id='__MASTODON_PY_TEST_ID', | 8 | client_id='__MASTODON_PY_TEST_CLIENT_ID', |
9 | client_secret='__MASTODON_PY_TEST_SECRET', | 9 | client_secret='__MASTODON_PY_TEST_CLIENT_SECRET', |
10 | access_token='__MASTODON_PY_TEST_TOKEN') | 10 | access_token=access_token) |
11 | |||
12 | |||
13 | @pytest.fixture | ||
14 | def api(): | ||
15 | return _api() | ||
16 | |||
17 | |||
18 | @pytest.fixture | ||
19 | def api2(): | ||
20 | return _api(access_token='__MASTODON_PY_TEST_ACCESS_TOKEN_2') | ||
21 | |||
11 | 22 | ||
12 | @pytest.fixture | 23 | @pytest.fixture |
13 | def api_anonymous(): | 24 | def api_anonymous(): |
14 | import mastodon | 25 | return _api(access_token=None) |
15 | return mastodon.Mastodon( | ||
16 | api_base_url='http://localhost:3000', | ||
17 | client_id='__MASTODON_PY_TEST_ID', | ||
18 | client_secret='__MASTODON_PY_TEST_SECRET') | ||
19 | 26 | ||
20 | @pytest.fixture() | 27 | @pytest.fixture() |
21 | def status(api): | 28 | def status(api): |