File tree Expand file tree Collapse file tree 2 files changed +19
-1
lines changed Expand file tree Collapse file tree 2 files changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -18,6 +18,12 @@ async def on_ready():
18
18
async def ping (ctx ):
19
19
await ctx .send ("Pong!" )
20
20
21
+
22
+ @bot .command ()
23
+ async def source (ctx ):
24
+ await ctx .send ("I'm here: https://github.com/europython/internal-bot" )
25
+
26
+
21
27
@bot .command ()
22
28
async def version (ctx ):
23
29
app_version = settings .APP_VERSION
Original file line number Diff line number Diff line change 1
1
from unittest .mock import AsyncMock
2
2
3
3
import pytest
4
- from core .bot .main import ping , version
4
+ from core .bot .main import ping , version , source
5
5
6
6
7
7
@pytest .mark .asyncio
@@ -26,3 +26,15 @@ async def test_version_command():
26
26
27
27
# Assert that the command sent the expected message
28
28
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" )
You can’t perform that action at this time.
0 commit comments