- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 11 for test (0.12 sec)
-
tests/test_tutorial/test_handling_errors/test_tutorial004.py
"value is not a valid integer" in response.text or "Input should be a valid integer, unable to parse string as an integer" in response.text ) def test_get_http_error(): response = client.get("/items/3") assert response.status_code == 418, response.text assert response.content == b"Nope! I don't like 3." def test_get(): response = client.get("/items/2")
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Fri Jul 07 17:12:13 GMT 2023 - 3.7K bytes - Viewed (0) -
tests/test_tutorial/test_path_params/test_tutorial004.py
from docs_src.path_params.tutorial004 import app client = TestClient(app) def test_file_path(): response = client.get("/files/home/johndoe/myfile.txt") print(response.content) assert response.status_code == 200, response.text assert response.json() == {"file_path": "home/johndoe/myfile.txt"} def test_root_file_path(): response = client.get("/files//home/johndoe/myfile.txt") print(response.content)
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) -
tests/test_tutorial/test_response_model/test_tutorial004.py
"tags": [], }, ), ], ) def test_get(url, data): response = client.get(url) assert response.status_code == 200, response.text assert response.json() == data def test_openapi_schema(): response = client.get("/openapi.json") assert response.status_code == 200, response.text assert response.json() == { "openapi": "3.1.0",
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Fri Aug 04 20:47:07 GMT 2023 - 5K bytes - Viewed (0) -
tests/test_tutorial/test_dependencies/test_tutorial004.py
), ], ) def test_get(path, expected_status, expected_response): response = client.get(path) 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, response.text 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 - 5.4K bytes - Viewed (0) -
tests/test_tutorial/test_additional_responses/test_tutorial004.py
from docs_src.additional_responses.tutorial004 import app 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")
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Fri Jul 07 17:12:13 GMT 2023 - 4.8K bytes - Viewed (0) -
tests/test_tutorial/test_behind_a_proxy/test_tutorial004.py
from fastapi.testclient import TestClient from docs_src.behind_a_proxy.tutorial004 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_schema(): 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 Jul 07 17:12:13 GMT 2023 - 1.6K bytes - Viewed (0) -
tests/test_tutorial/test_schema_extra_example/test_tutorial004.py
from dirty_equals import IsDict from fastapi.testclient import TestClient from docs_src.schema_extra_example.tutorial004 import app client = TestClient(app) # Test required and embedded body parameters with no bodies sent def test_post_body_example(): response = client.put( "/items/5", json={ "name": "Foo", "description": "A very nice Item", "price": 35.4,
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Fri Jul 07 17:12:13 GMT 2023 - 6.9K bytes - Viewed (0) -
tests/test_tutorial/test_custom_response/test_tutorial004.py
</body> </html> """ def test_get_custom_response(): response = client.get("/items/") assert response.status_code == 200, response.text assert response.text == html_contents def test_openapi_schema(): response = client.get("/openapi.json") assert response.status_code == 200, response.text assert response.json() == { "openapi": "3.1.0",
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Fri Jun 30 18:25:16 GMT 2023 - 1.2K bytes - Viewed (0) -
tests/test_tutorial/test_extra_models/test_tutorial004.py
client = TestClient(app) def test_get_items(): response = client.get("/items/") assert response.status_code == 200, response.text assert response.json() == [ {"name": "Foo", "description": "There comes my hero"}, {"name": "Red", "description": "It's my aeroplane"}, ] def test_openapi_schema(): response = client.get("/openapi.json")
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Fri Jun 30 18:25:16 GMT 2023 - 1.9K bytes - Viewed (0) -
tests/test_tutorial/test_metadata/test_tutorial004.py
client = TestClient(app) def test_path_operations(): response = client.get("/items/") assert response.status_code == 200, response.text response = client.get("/users/") assert response.status_code == 200, response.text 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: Fri Jun 30 18:25:16 GMT 2023 - 2K bytes - Viewed (0)