aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_constructor.py')
-rw-r--r--tests/test_constructor.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/tests/test_constructor.py b/tests/test_constructor.py
index fac3763..a599df6 100644
--- a/tests/test_constructor.py
+++ b/tests/test_constructor.py
@@ -2,10 +2,14 @@ import pytest
2from mastodon import Mastodon 2from mastodon import Mastodon
3from mastodon.Mastodon import MastodonIllegalArgumentError 3from mastodon.Mastodon import MastodonIllegalArgumentError
4 4
5def test_constructor_from_filenames(): 5def test_constructor_from_filenames(tmpdir):
6 client = tmpdir.join('client')
7 client.write_text('foo\nbar\n', 'UTF-8')
8 access = tmpdir.join('access')
9 access.write_text('baz\n', 'UTF-8')
6 api = Mastodon( 10 api = Mastodon(
7 'tests/client.credentials', 11 str(client),
8 access_token = 'tests/access.credentials') 12 access_token = str(access))
9 assert api.client_id == 'foo' 13 assert api.client_id == 'foo'
10 assert api.client_secret == 'bar' 14 assert api.client_secret == 'bar'
11 assert api.access_token == 'baz' 15 assert api.access_token == 'baz'
Powered by cgit v1.2.3 (git 2.41.0)