Browse Source

Update tests for HTML content and remove unneeded tests

pull/11/head
Sebastián Ramírez 6 years ago
parent
commit
252188c686
  1. 0
      tests/endpoints/__init__.py
  2. 13
      tests/endpoints/a.py
  3. 13
      tests/endpoints/b.py
  4. 2
      tests/test_application.py

0
tests/endpoints/__init__.py

13
tests/endpoints/a.py

@ -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"

13
tests/endpoints/b.py

@ -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"

2
tests/test_application.py

@ -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…
Cancel
Save