1 changed files with 25 additions and 0 deletions
@ -0,0 +1,25 @@ |
|||
from typing import List |
|||
|
|||
from fastapi import FastAPI |
|||
from fastapi.testclient import TestClient |
|||
from pydantic import BaseModel, v1 |
|||
|
|||
|
|||
class Model(v1.BaseModel): |
|||
name: str |
|||
|
|||
|
|||
app = FastAPI() |
|||
|
|||
|
|||
@app.get("/valid", response_model=Model) |
|||
def valid1(): |
|||
pass |
|||
|
|||
|
|||
client = TestClient(app) |
|||
|
|||
|
|||
def test_path_operations(): |
|||
response = client.get("/valid") |
|||
assert response.status_code == 200, response.text |
Loading…
Reference in new issue