- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 12 for silent (0.3 sec)
-
tests/test_tutorial/test_additional_responses/test_tutorial002.py
client = TestClient(app) def test_path_operation(): response = client.get("/items/foo") assert response.status_code == 200, response.text assert response.json() == {"id": "foo", "value": "there goes my hero"} def test_path_operation_img(): shutil.copy("./docs/en/docs/img/favicon.png", "./image.png") response = client.get("/items/foo?img=1")
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Fri Jul 07 17:12:13 GMT 2023 - 4.6K bytes - Viewed (0) -
tests/test_tutorial/test_path_operation_advanced_configurations/test_tutorial002.py
from docs_src.path_operation_advanced_configuration.tutorial002 import app client = TestClient(app) def test_get(): response = client.get("/items/") assert response.status_code == 200, response.text assert response.json() == [{"item_id": "Foo"}] def test_openapi_schema(): response = client.get("/openapi.json") assert response.status_code == 200, response.text
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Fri Jun 30 18:25:16 GMT 2023 - 1020 bytes - Viewed (0) -
tests/test_tutorial/test_behind_a_proxy/test_tutorial002.py
from fastapi.testclient import TestClient from docs_src.behind_a_proxy.tutorial002 import app client = TestClient(app) def test_main(): response = client.get("/app") assert response.status_code == 200 assert response.json() == {"message": "Hello World", "root_path": "/api/v1"} def test_openapi(): response = client.get("/openapi.json") assert response.status_code == 200 assert response.json() == {
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Fri Jun 30 18:25:16 GMT 2023 - 1K bytes - Viewed (0) -
tests/test_tutorial/test_configure_swagger_ui/test_tutorial002.py
from fastapi.testclient import TestClient from docs_src.configure_swagger_ui.tutorial002 import app client = TestClient(app) def test_swagger_ui(): response = client.get("/docs") assert response.status_code == 200, response.text assert ( '"syntaxHighlight": false' not in response.text ), "not used parameters should not be included" assert ( '"syntaxHighlight.theme": "obsidian"' in response.text
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Sat Aug 19 19:54:04 GMT 2023 - 1.5K bytes - Viewed (0) -
tests/test_tutorial/test_header_params/test_tutorial002.py
), ], ) def test(path, headers, expected_status, expected_response): response = client.get(path, headers=headers) assert response.status_code == expected_status assert response.json() == expected_response def test_openapi_schema(): response = client.get("/openapi.json") assert response.status_code == 200 assert response.json() == { "openapi": "3.1.0",
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Fri Jul 07 17:12:13 GMT 2023 - 4K bytes - Viewed (0) -
tests/test_tutorial/test_custom_docs_ui/test_tutorial002.py
@pytest.fixture(scope="module") def client(): static_dir: Path = Path(os.getcwd()) / "static" print(static_dir) static_dir.mkdir(exist_ok=True) from docs_src.custom_docs_ui.tutorial002 import app with TestClient(app) as client: yield client static_dir.rmdir() def test_swagger_ui_html(client: TestClient): response = client.get("/docs")
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Sat Aug 19 19:54:04 GMT 2023 - 1.2K bytes - Viewed (0) -
tests/test_tutorial/test_custom_request_and_route/test_tutorial002.py
from fastapi.testclient import TestClient from docs_src.custom_request_and_route.tutorial002 import app client = TestClient(app) def test_endpoint_works(): response = client.post("/", json=[1, 2, 3]) assert response.json() == 6 def test_exception_handler_body_access(): response = client.post("/", json={"numbers": [1, 2, 3]}) assert response.json() == IsDict( { "detail": {
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Thu Apr 18 19:40:57 GMT 2024 - 1.2K bytes - Viewed (0) -
tests/test_tutorial/test_request_files/test_tutorial002.py
assert response.json() == {"filenames": ["test.txt", "test2.txt"]} def test_get_root(): client = TestClient(app) response = client.get("/") assert response.status_code == 200, response.text assert b"<form" in response.content def test_openapi_schema(): response = client.get("/openapi.json") assert response.status_code == 200, response.text assert response.json() == {
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Thu Apr 18 19:40:57 GMT 2024 - 8.5K bytes - Viewed (0) -
tests/test_tutorial/test_events/test_tutorial002.py
with TestClient(app) as client: response = client.get("/items/") assert response.status_code == 200, response.text assert response.json() == [{"name": "Foo"}] with open("log.txt") as log: assert "Application shutdown" in log.read() def test_openapi_schema(app: FastAPI): with TestClient(app) as client: response = client.get("/openapi.json")
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Wed Oct 18 12:36:40 GMT 2023 - 1.4K bytes - Viewed (0) -
tests/test_tutorial/test_handling_errors/test_tutorial002.py
from docs_src.handling_errors.tutorial002 import app client = TestClient(app) def test_get_item_header(): response = client.get("/items-header/foo") assert response.status_code == 200, response.text assert response.json() == {"item": "The Foo Wrestlers"} def test_get_item_not_found_header(): response = client.get("/items-header/bar") assert response.status_code == 404, response.text
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Fri Jun 30 18:25:16 GMT 2023 - 3.3K bytes - Viewed (0)