diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_constructor.py | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/test_constructor.py b/tests/test_constructor.py new file mode 100644 index 0000000..720f58d --- /dev/null +++ b/tests/test_constructor.py | |||
@@ -0,0 +1,21 @@ | |||
1 | import pytest | ||
2 | from mastodon import Mastodon | ||
3 | from mastodon.Mastodon import MastodonIllegalArgumentError | ||
4 | |||
5 | def test_constructor_from_filenames(): | ||
6 | api = Mastodon( | ||
7 | 'client.credentials', | ||
8 | access_token = 'access.credentials') | ||
9 | assert api.client_id == 'foo' | ||
10 | assert api.client_secret == 'bar' | ||
11 | assert api.access_token == 'baz' | ||
12 | |||
13 | def test_constructor_illegal_ratelimit(): | ||
14 | with pytest.raises(MastodonIllegalArgumentError): | ||
15 | api = Mastodon( | ||
16 | 'foo', client_secret='bar', | ||
17 | ratelimit_method='baz') | ||
18 | |||
19 | def test_constructor_missing_client_secret(): | ||
20 | with pytest.raises(MastodonIllegalArgumentError): | ||
21 | api = Mastodon('foo') | ||