aboutsummaryrefslogtreecommitdiff
blob: fac3763a8605ad7b3b8bfc950c68a942c4a3392d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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')
Powered by cgit v1.2.3 (git 2.41.0)