diff options
author | Lorenz Diener <[email protected]> | 2017-11-29 17:48:56 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2017-11-29 17:48:56 +0100 |
commit | 961425e2abc91d693004f2c0d073e387de64e58c (patch) | |
tree | 8b1512daf97ab63b54f4edebc83b35f524571c53 /tests/conftest.py | |
parent | 5b811b719d379be06ed256da2ee806a051461795 (diff) | |
parent | e79987df2410ee32302abed9e486a72b2dfc9707 (diff) | |
download | mastodon.py-961425e2abc91d693004f2c0d073e387de64e58c.tar.gz |
Merge pull request #109 from codl/test-suite
Test suite
Diffstat (limited to 'tests/conftest.py')
-rw-r--r-- | tests/conftest.py | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/tests/conftest.py b/tests/conftest.py new file mode 100644 index 0000000..a0733b5 --- /dev/null +++ b/tests/conftest.py | |||
@@ -0,0 +1,32 @@ | |||
1 | import pytest | ||
2 | |||
3 | @pytest.fixture | ||
4 | def api(): | ||
5 | import mastodon | ||
6 | return mastodon.Mastodon( | ||
7 | api_base_url='http://localhost:3000', | ||
8 | client_id='__MASTODON_PY_TEST_ID', | ||
9 | client_secret='__MASTODON_PY_TEST_SECRET', | ||
10 | access_token='__MASTODON_PY_TEST_TOKEN') | ||
11 | |||
12 | @pytest.fixture | ||
13 | def api_anonymous(): | ||
14 | import mastodon | ||
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 | |||
20 | @pytest.fixture() | ||
21 | def status(api): | ||
22 | _status = api.status_post('Toot!') | ||
23 | yield _status | ||
24 | api.status_delete(_status['id']) | ||
25 | |||
26 | |||
27 | @pytest.fixture() | ||
28 | def vcr_config(): | ||
29 | return dict( | ||
30 | match_on = ['method', 'path', 'query', 'body'], | ||
31 | decode_compressed_response = True | ||
32 | ) | ||