2017-11-27 02:25:33 +01:00
|
|
|
import pytest
|
|
|
|
|
|
|
|
@pytest.fixture
|
2017-11-27 14:35:02 +01:00
|
|
|
def api():
|
|
|
|
import mastodon
|
|
|
|
return mastodon.Mastodon(
|
2017-11-27 02:25:33 +01:00
|
|
|
api_base_url='http://localhost:3000',
|
|
|
|
client_id='__MASTODON_PY_TEST_ID',
|
|
|
|
client_secret='__MASTODON_PY_TEST_SECRET',
|
|
|
|
access_token='__MASTODON_PY_TEST_TOKEN')
|
|
|
|
|
2017-11-27 14:19:21 +01:00
|
|
|
@pytest.fixture
|
2017-11-27 14:35:02 +01:00
|
|
|
def api_anonymous():
|
|
|
|
import mastodon
|
|
|
|
return mastodon.Mastodon(
|
2017-11-27 14:19:21 +01:00
|
|
|
api_base_url='http://localhost:3000',
|
|
|
|
client_id='__MASTODON_PY_TEST_ID',
|
|
|
|
client_secret='__MASTODON_PY_TEST_SECRET')
|
|
|
|
|
2017-11-27 02:25:33 +01:00
|
|
|
@pytest.fixture()
|
2017-11-27 14:35:02 +01:00
|
|
|
def status(api):
|
|
|
|
_status = api.status_post('Toot!')
|
2017-11-27 02:25:33 +01:00
|
|
|
yield _status
|
2017-11-27 14:35:02 +01:00
|
|
|
api.status_delete(_status['id'])
|
2017-11-27 02:25:33 +01:00
|
|
|
|
2017-11-27 04:22:03 +01:00
|
|
|
|
2017-11-27 02:25:33 +01:00
|
|
|
@pytest.fixture()
|
|
|
|
def vcr_config():
|
|
|
|
return dict(
|
|
|
|
match_on = ['method', 'path', 'query', 'body'],
|
|
|
|
decode_compressed_response = True
|
|
|
|
)
|