diff options
author | Lorenz Diener <[email protected]> | 2017-11-30 16:02:52 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2017-11-30 16:02:52 +0100 |
commit | 7e3a4a17a28f52b186e6453a0d1f43614f110b4b (patch) | |
tree | 48aafcc35397205d52613cc305dc6baff1cbbda1 /tests/conftest.py | |
parent | c6f1196ddc1899e64d60b102e1cfa1c1c1321e77 (diff) | |
parent | d87ada3d73de69ba371acaeca55751e2410c3786 (diff) | |
download | mastodon.py-7e3a4a17a28f52b186e6453a0d1f43614f110b4b.tar.gz |
Merge pull request #113 from codl/more-tests
More tests!
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): |