Mastodonplus.py/tests/test_constructor.py
codl 80b1ce61c9
move test credential files to /tests/
i didnt even realise i put them there whoops
2017-11-27 17:13:54 +01:00

21 líneas
703 B
Python

import pytest
from mastodon import Mastodon
from mastodon.Mastodon import MastodonIllegalArgumentError
def test_constructor_from_filenames():
api = Mastodon(
'tests/client.credentials',
access_token = 'tests/access.credentials')
assert api.client_id == 'foo'
assert api.client_secret == 'bar'
assert api.access_token == 'baz'
def test_constructor_illegal_ratelimit():
with pytest.raises(MastodonIllegalArgumentError):
api = Mastodon(
'foo', client_secret='bar',
ratelimit_method='baz')
def test_constructor_missing_client_secret():
with pytest.raises(MastodonIllegalArgumentError):
api = Mastodon('foo')