Skip to content

Commit 7f9f07a

Browse files
author
mongkok
committed
Added test_json for cookie-based coverage
1 parent d1accb3 commit 7f9f07a

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

tests/test_middleware.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
from fastapi import status
2-
3-
from .testclient import TestClient
2+
from fastapi.testclient import TestClient
43

54

65
def test_sync(client: TestClient) -> None:
@@ -13,6 +12,11 @@ def test_async(client: TestClient) -> None:
1312
assert response.status_code == status.HTTP_200_OK
1413

1514

15+
def test_json(client: TestClient) -> None:
16+
response = client.get("/openapi.json")
17+
assert response.status_code == status.HTTP_200_OK
18+
19+
1620
def test_404(client: TestClient) -> None:
1721
response = client.get("/404")
1822
assert response.status_code == status.HTTP_404_NOT_FOUND

0 commit comments

Comments
 (0)