diff options
author | codl <[email protected]> | 2017-11-27 02:25:33 +0100 |
---|---|---|
committer | codl <[email protected]> | 2017-11-27 03:12:02 +0100 |
commit | 4b60a0d3cfba50319d2a8a47458db9a89a1a4f12 (patch) | |
tree | 0d61d4e79ed28567b8ab63b12d98aaa463927b0f /tests/fixtures.py | |
parent | 430bebc12481c1ad44592f03ad7d8acbed370eab (diff) | |
download | mastodon.py-4b60a0d3cfba50319d2a8a47458db9a89a1a4f12.tar.gz |
add tests for json hooks
including a failing test for that thing i fixed earlier which isn't
in this branch 😓
Diffstat (limited to 'tests/fixtures.py')
-rw-r--r-- | tests/fixtures.py | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/fixtures.py b/tests/fixtures.py new file mode 100644 index 0000000..1b32866 --- /dev/null +++ b/tests/fixtures.py | |||
@@ -0,0 +1,25 @@ | |||
1 | import pytest | ||
2 | |||
3 | @pytest.fixture | ||
4 | def mastodon(): | ||
5 | import mastodon as _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 | |||
13 | |||
14 | @pytest.fixture() | ||
15 | def status(mastodon): | ||
16 | _status = mastodon.status_post('Toot!') | ||
17 | yield _status | ||
18 | mastodon.status_delete(_status['id']) | ||
19 | |||
20 | @pytest.fixture() | ||
21 | def vcr_config(): | ||
22 | return dict( | ||
23 | match_on = ['method', 'path', 'query', 'body'], | ||
24 | decode_compressed_response = True | ||
25 | ) | ||