aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLorenz Diener <[email protected]>2017-11-29 17:48:56 +0100
committerGitHub <[email protected]>2017-11-29 17:48:56 +0100
commit961425e2abc91d693004f2c0d073e387de64e58c (patch)
tree8b1512daf97ab63b54f4edebc83b35f524571c53 /tests/conftest.py
parent5b811b719d379be06ed256da2ee806a051461795 (diff)
parente79987df2410ee32302abed9e486a72b2dfc9707 (diff)
downloadmastodon.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.py32
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 @@
1import pytest
2
3@pytest.fixture
4def 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
13def 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()
21def status(api):
22 _status = api.status_post('Toot!')
23 yield _status
24 api.status_delete(_status['id'])
25
26
27@pytest.fixture()
28def vcr_config():
29 return dict(
30 match_on = ['method', 'path', 'query', 'body'],
31 decode_compressed_response = True
32 )
Powered by cgit v1.2.3 (git 2.41.0)