diff options
| author | romangraef <romangraef@loves.dicksinhisan.us> | 2018-08-18 20:15:24 +0200 |
|---|---|---|
| committer | romangraef <romangraef@loves.dicksinhisan.us> | 2018-08-18 20:15:24 +0200 |
| commit | 1861ecb4307220e70dca6ad47873c77d197d4626 (patch) | |
| tree | fcd7dedb435eab916275d90e4984d36bb49b1cc8 /tests | |
| download | discord_ban_list-1861ecb4307220e70dca6ad47873c77d197d4626.tar.gz discord_ban_list-1861ecb4307220e70dca6ad47873c77d197d4626.tar.bz2 discord_ban_list-1861ecb4307220e70dca6ad47873c77d197d4626.zip | |
Initial commit
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/test_login.py | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/tests/test_login.py b/tests/test_login.py new file mode 100644 index 0000000..fb8f086 --- /dev/null +++ b/tests/test_login.py @@ -0,0 +1,32 @@ +import os +from asyncio import get_event_loop +from unittest import TestCase + +from discord_ban_list import DiscordBanList + + +async def a_test_valid_login(): + ban_list = DiscordBanList(os.environ['token']) + await ban_list.login() + ban = await ban_list.check(123) + assert not ban.banned + + +async def a_test_banned(): + user = 123456789123456789 + ban_list = DiscordBanList(os.environ['token']) + await ban_list.login() + ban = await ban_list.check(user) + assert ban.banned + assert ban.user_id == user + assert ban.case_id == 9999 + assert ban.reason == "THIS IS A VIRTUAL DBANS API TESTING ACCOUNT" + assert ban.proof == "https://yourmom-is.gae" + + +class TestSomething(TestCase): + def test_not_banned(self): + get_event_loop().run_until_complete(a_test_valid_login()) + + def test_banned(self): + get_event_loop().run_until_complete(a_test_banned()) |
