We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3181405 commit 9bbbc21Copy full SHA for 9bbbc21
test_index.py
@@ -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
14
+async def test_say_hello():
15
+ result = await say_hello("John")
16
+ assert result == {'message': 'Hello John'}
17
18
19
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