aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcodl <[email protected]>2017-11-29 21:42:20 +0100
committercodl <[email protected]>2017-11-29 22:06:24 +0100
commit309cc26ded4fd30f970c58d9c9f7d88b327f7c18 (patch)
tree6f1e9884fb2c7d32d2097ba9340dcc5d83cda9ed /tests/conftest.py
parent0f753e621a0804dfc8a08e1f5f90972be75c4ff5 (diff)
downloadmastodon.py-309cc26ded4fd30f970c58d9c9f7d88b327f7c18.tar.gz
add another user to the test setup
Diffstat (limited to 'tests/conftest.py')
-rw-r--r--tests/conftest.py27
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 @@
1import pytest 1import pytest
2 2
3@pytest.fixture 3
4def api(): 4def _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
14def api():
15 return _api()
16
17
18@pytest.fixture
19def api2():
20 return _api(access_token='__MASTODON_PY_TEST_ACCESS_TOKEN_2')
21
11 22
12@pytest.fixture 23@pytest.fixture
13def api_anonymous(): 24def 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()
21def status(api): 28def status(api):
Powered by cgit v1.2.3 (git 2.41.0)