Inital commit
This commit is contained in:
4
app/test/__init__.py
Normal file
4
app/test/__init__.py
Normal file
@@ -0,0 +1,4 @@
|
||||
import sys
|
||||
import os
|
||||
|
||||
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), "..")))
|
10
app/test/test_main.py
Normal file
10
app/test/test_main.py
Normal file
@@ -0,0 +1,10 @@
|
||||
from fastapi.testclient import TestClient
|
||||
import app.main
|
||||
|
||||
client = TestClient(app.main.app)
|
||||
|
||||
|
||||
def test_read_main():
|
||||
response = client.get("/")
|
||||
assert response.status_code == 200
|
||||
assert response.json() == {"msg": "Hello World"}
|
Reference in New Issue
Block a user