Browse Source

New tests added: tutorial:Path Parameters, tests/test_tutorial/test_path_params/test_tutorial003b.py

pull/13476/head
alv2017 4 weeks ago
parent
commit
3cee816fbe
  1. 15
      tests/test_tutorial/test_path_params/test_tutorial003b.py

15
tests/test_tutorial/test_path_params/test_tutorial003b.py

@ -0,0 +1,15 @@
import pytest
from fastapi.testclient import TestClient
from docs_src.path_params.tutorial003b import app
@pytest.fixture(name="client")
def get_client():
return TestClient(app)
def test_get_users(client):
response = client.get("/users")
assert response.status_code == 200
assert response.json() == ["Rick", "Morty"]
Loading…
Cancel
Save