From 4b60a0d3cfba50319d2a8a47458db9a89a1a4f12 Mon Sep 17 00:00:00 2001 From: codl Date: Mon, 27 Nov 2017 02:25:33 +0100 Subject: add tests for json hooks MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit including a failing test for that thing i fixed earlier which isn't in this branch 😓 --- tests/fixtures.py | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 tests/fixtures.py (limited to 'tests/fixtures.py') 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 @@ +import pytest + +@pytest.fixture +def mastodon(): + import mastodon as _mastodon + return _mastodon.Mastodon( + api_base_url='http://localhost:3000', + client_id='__MASTODON_PY_TEST_ID', + client_secret='__MASTODON_PY_TEST_SECRET', + access_token='__MASTODON_PY_TEST_TOKEN') + + + +@pytest.fixture() +def status(mastodon): + _status = mastodon.status_post('Toot!') + yield _status + mastodon.status_delete(_status['id']) + +@pytest.fixture() +def vcr_config(): + return dict( + match_on = ['method', 'path', 'query', 'body'], + decode_compressed_response = True + ) -- cgit v1.2.3