diff options
author | codl <[email protected]> | 2017-11-27 04:22:03 +0100 |
---|---|---|
committer | codl <[email protected]> | 2017-11-27 14:20:31 +0100 |
commit | 765db0fc8149aad4c103244e013fdd128af8d3d2 (patch) | |
tree | e8c590492f114e024135ed8584bcab7276e8a1f9 /tests/conftest.py | |
parent | d09d27cdd25a6277333b65953d546bd281e380da (diff) | |
download | mastodon.py-765db0fc8149aad4c103244e013fdd128af8d3d2.tar.gz |
move fixtures.py to standardized location conftest.py
Diffstat (limited to 'tests/conftest.py')
-rw-r--r-- | tests/conftest.py | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/conftest.py b/tests/conftest.py new file mode 100644 index 0000000..1858ab8 --- /dev/null +++ b/tests/conftest.py | |||
@@ -0,0 +1,24 @@ | |||
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 | @pytest.fixture() | ||
13 | def status(mastodon): | ||
14 | _status = mastodon.status_post('Toot!') | ||
15 | yield _status | ||
16 | mastodon.status_delete(_status['id']) | ||
17 | |||
18 | |||
19 | @pytest.fixture() | ||
20 | def vcr_config(): | ||
21 | return dict( | ||
22 | match_on = ['method', 'path', 'query', 'body'], | ||
23 | decode_compressed_response = True | ||
24 | ) | ||