From 1af0aa1f98528c89ee9c398478c2db710d0cce7b Mon Sep 17 00:00:00 2001 From: Mgcsuper <152525588+Mgcsuper@users.noreply.github.com> Date: Fri, 19 Apr 2024 08:14:39 +0200 Subject: [PATCH] Update and rename test_tutorial003.py to test_tutorial003b.py it was tutorial003b with over fonction names --- .../{test_tutorial003.py => test_tutorial003b.py} | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) rename tests/test_tutorial/test_path_params/{test_tutorial003.py => test_tutorial003b.py} (59%) diff --git a/tests/test_tutorial/test_path_params/test_tutorial003.py b/tests/test_tutorial/test_path_params/test_tutorial003b.py similarity index 59% rename from tests/test_tutorial/test_path_params/test_tutorial003.py rename to tests/test_tutorial/test_path_params/test_tutorial003b.py index 448b53e30..864314bf6 100644 --- a/tests/test_tutorial/test_path_params/test_tutorial003.py +++ b/tests/test_tutorial/test_path_params/test_tutorial003b.py @@ -1,26 +1,25 @@ from fastapi.routing import APIRoute from fastapi.testclient import TestClient -import docs_src.path_params.tutorial003 as t3 +import docs_src.path_params.tutorial003b as t3 client = TestClient(t3.app) def test_get_users(): response = client.get("/users") - print(response.json()) assert response.status_code == 200 - assert response.json() == {"user_id": "the current user"} + assert response.json() == ['Rick', 'Morty'] def test_routes_created(): root1 = APIRoute( - path="/users", endpoint=t3.read_user, methods=["GET"], name="name='read_user" + path="/users", endpoint=t3.read_users, methods=["GET"], name="read_users" ) root2 = APIRoute( path="/users", - endpoint=t3.read_user_me, + endpoint=t3.read_users2, methods=["GET"], - name="name='read_user_me'", + name="read_users2", ) assert (root1 in t3.app.router.routes) and (root2 in t3.app.router.routes)