Skip to content

Commit 1d76b3d

Browse files
committed
✨ Add basic bot start test with expected LoginFailure
Signed-off-by: Paillat-dev <[email protected]>
1 parent e727990 commit 1d76b3d

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

tests/test_basic_bot.py

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import pytest
2+
3+
import discord
4+
5+
6+
@pytest.mark.asyncio
7+
async def test_bot_login_failure_login():
8+
bot = discord.Bot()
9+
10+
with pytest.raises(discord.LoginFailure):
11+
await bot.login("invalid_token")
12+
13+
14+
@pytest.mark.asyncio
15+
async def test_bot_login_failure_start():
16+
bot = discord.Bot()
17+
18+
with pytest.raises(discord.LoginFailure):
19+
await bot.start("invalid_token")
20+
21+
22+
def test_bot_login_failure_run():
23+
bot = discord.Bot()
24+
25+
with pytest.raises(discord.LoginFailure):
26+
bot.run("invalid_token")

0 commit comments

Comments
 (0)