Skip to content

Commit 574345f

Browse files
committed
add source command
1 parent 0a82886 commit 574345f

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

intbot/core/bot/main.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,12 @@ async def on_ready():
1818
async def ping(ctx):
1919
await ctx.send("Pong!")
2020

21+
22+
@bot.command()
23+
async def source(ctx):
24+
await ctx.send("I'm here: https://github.com/europython/internal-bot")
25+
26+
2127
@bot.command()
2228
async def version(ctx):
2329
app_version = settings.APP_VERSION

intbot/tests/test_bot.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from unittest.mock import AsyncMock
22

33
import pytest
4-
from core.bot.main import ping, version
4+
from core.bot.main import ping, version, source
55

66

77
@pytest.mark.asyncio
@@ -26,3 +26,15 @@ async def test_version_command():
2626

2727
# Assert that the command sent the expected message
2828
ctx.send.assert_called_once_with("Version: latest")
29+
30+
31+
@pytest.mark.asyncio
32+
async def test_source_command():
33+
# Mock context
34+
ctx = AsyncMock()
35+
36+
# Call the command
37+
await source(ctx)
38+
39+
# Assert that the command sent the expected message
40+
ctx.send.assert_called_once_with("I'm here: https://github.com/europython/internal-bot")

0 commit comments

Comments
 (0)