Skip to content

Commit 9bbbc21

Browse files
committed
test: create test_index.py
1 parent 3181405 commit 9bbbc21

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

test_index.py

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import pytest
2+
3+
from src.dtos.ISayHelloDto import ISayHelloDto
4+
from src.index import root, say_hello, hello_message
5+
6+
7+
@pytest.mark.asyncio
8+
async def test_root():
9+
result = await root()
10+
assert result == {'message': 'Hello World'}
11+
12+
13+
@pytest.mark.asyncio
14+
async def test_say_hello():
15+
result = await say_hello("John")
16+
assert result == {'message': 'Hello John'}
17+
18+
19+
@pytest.mark.asyncio
20+
async def test_hello_message():
21+
dto = ISayHelloDto(message="Alice")
22+
result = await hello_message(dto)
23+
assert result == {'message': 'Hello Alice'}

0 commit comments

Comments
 (0)