From e8d10795621730ffdab5be67c913d68e5d9abe07 Mon Sep 17 00:00:00 2001 From: codl Date: Mon, 27 Nov 2017 17:47:15 +0100 Subject: constructor tests: create credential files at runtime --- tests/access.credentials | 1 - tests/client.credentials | 2 -- tests/test_constructor.py | 10 +++++++--- 3 files changed, 7 insertions(+), 6 deletions(-) delete mode 100644 tests/access.credentials delete mode 100644 tests/client.credentials diff --git a/tests/access.credentials b/tests/access.credentials deleted file mode 100644 index 7601807..0000000 --- a/tests/access.credentials +++ /dev/null @@ -1 +0,0 @@ -baz diff --git a/tests/client.credentials b/tests/client.credentials deleted file mode 100644 index 3bd1f0e..0000000 --- a/tests/client.credentials +++ /dev/null @@ -1,2 +0,0 @@ -foo -bar 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 from mastodon import Mastodon from mastodon.Mastodon import MastodonIllegalArgumentError -def test_constructor_from_filenames(): +def test_constructor_from_filenames(tmpdir): + client = tmpdir.join('client') + client.write_text('foo\nbar\n', 'UTF-8') + access = tmpdir.join('access') + access.write_text('baz\n', 'UTF-8') api = Mastodon( - 'tests/client.credentials', - access_token = 'tests/access.credentials') + str(client), + access_token = str(access)) assert api.client_id == 'foo' assert api.client_secret == 'bar' assert api.access_token == 'baz' -- cgit v1.2.3