Skip to content

Commit e564995

Browse files
committed
✨ Add basic bot start test with expected LoginFailure
Signed-off-by: Paillat-dev <paillat@pycord.dev>
1 parent e727990 commit e564995

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

tests/test_basic_bot.py

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

0 commit comments

Comments
 (0)