Skip to content

Commit

Permalink
Cleanup some tests
Browse files Browse the repository at this point in the history
  • Loading branch information
LilSpazJoekp committed Jun 15, 2021
1 parent 9aa6651 commit f4cec73
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion tests/unit/models/reddit/test_collections.py
Expand Up @@ -63,7 +63,7 @@ def test_neq(self):
class TestSubredditCollections(UnitTest):
async def test_call(self):
collections = SubredditCollections(
self.reddit, self.reddit.subreddit("placeholder")
self.reddit, await self.reddit.subreddit("placeholder")
)
with pytest.raises(TypeError):
await collections()
Expand Down
8 changes: 6 additions & 2 deletions tests/unit/models/reddit/test_removal_reasons.py
Expand Up @@ -47,10 +47,14 @@ def test_exception(self):
_data={},
)
with pytest.raises(ValueError):
RemovalReason(self.reddit, subreddit=self.reddit.subreddit("a"), id="")
RemovalReason(
self.reddit, subreddit=Subreddit(self.reddit, display_name="a"), id=""
)
with pytest.raises(ValueError):
RemovalReason(
self.reddit, subreddit=self.reddit.subreddit("a"), reason_id=""
self.reddit,
subreddit=Subreddit(self.reddit, display_name="a"),
reason_id="",
)

async def test__get(self):
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/util/test_token_manager.py
Expand Up @@ -36,13 +36,13 @@ def test_reddit__must_only_be_set_once(self):


class TestFileTokenManager(UnitTest):
def setUp(self):
async def setUp(self):
aiofiles.threadpool.wrap.register(mock.MagicMock)(
lambda *args, **kwargs: aiofiles.threadpool.AsyncBufferedIOBase(
*args, **kwargs
)
)
super(TestFileTokenManager, self).setUp()
await super(TestFileTokenManager, self).setUp()

async def test_post_refresh_token_callback__writes_to_file(self):
authorizer = DummyAuthorizer("token_value")
Expand Down

0 comments on commit f4cec73

Please sign in to comment.