mirror of https://github.com/tiangolo/fastapi.git
✅ Update tests for HTML content and remove unneeded tests
This commit is contained in:
parent
510fec9bee
commit
252188c686
|
|
@ -1,13 +0,0 @@
|
|||
from fastapi import APIRouter
|
||||
|
||||
router = APIRouter()
|
||||
|
||||
|
||||
@router.get("/dog")
|
||||
def get_a_dog():
|
||||
return "Woof"
|
||||
|
||||
|
||||
@router.get("/cat")
|
||||
def get_a_cat():
|
||||
return "Meow"
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
from fastapi import APIRouter
|
||||
|
||||
router = APIRouter()
|
||||
|
||||
|
||||
@router.get("/dog")
|
||||
def get_b_dog():
|
||||
return "B Woof"
|
||||
|
||||
|
||||
@router.get("/cat")
|
||||
def get_b_cat():
|
||||
return "B Meow"
|
||||
|
|
@ -1147,10 +1147,12 @@ def test_get_path(path, expected_status, expected_response):
|
|||
def test_swagger_ui():
|
||||
response = client.get("/docs")
|
||||
assert response.status_code == 200
|
||||
assert response.headers["content-type"] == "text/html; charset=utf-8"
|
||||
assert "swagger-ui-dist" in response.text
|
||||
|
||||
|
||||
def test_redoc():
|
||||
response = client.get("/redoc")
|
||||
assert response.status_code == 200
|
||||
assert response.headers["content-type"] == "text/html; charset=utf-8"
|
||||
assert "redoc@next" in response.text
|
||||
|
|
|
|||
Loading…
Reference in New Issue