- Sort Score
- Result 10 results
- Languages All
Results 41 - 50 of 1,075 for Upsert (0.08 sec)
-
tests/test_request_params/test_file/test_optional.py
response = client.post(path) assert response.status_code == 200, response.text assert response.json() == {"file_size": None} @pytest.mark.parametrize( "path", [ "/optional-bytes", "/optional-uploadfile", ], ) def test_optional(path: str): client = TestClient(app) response = client.post(path, files=[("p", b"hello")]) assert response.status_code == 200
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Sat Dec 27 18:19:10 UTC 2025 - 9.7K bytes - Viewed (0) -
tests/test_request_params/test_form/test_optional_str.py
response = client.post(path) assert response.status_code == 200 assert response.json() == {"p": None} @pytest.mark.parametrize( "path", ["/optional-str", "/model-optional-str"], ) def test_optional_str(path: str): client = TestClient(app) response = client.post(path, data={"p": "hello"}) assert response.status_code == 200 assert response.json() == {"p": "hello"}
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Sat Dec 27 18:19:10 UTC 2025 - 8.9K bytes - Viewed (0) -
tests/test_request_params/test_query/test_optional_list.py
response = client.get(path) assert response.status_code == 200, response.text assert response.json() == {"p": None} @pytest.mark.parametrize( "path", ["/optional-list-str", "/model-optional-list-str"], ) def test_optional_list_str(path: str): client = TestClient(app) response = client.get(f"{path}?p=hello&p=world") assert response.status_code == 200
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Sat Dec 27 18:19:10 UTC 2025 - 9.1K bytes - Viewed (0) -
tests/test_request_params/test_query/test_required_str.py
@pytest.mark.parametrize( "path", ["/required-str", "/model-required-str"], ) def test_required_str_missing(path: str): client = TestClient(app) response = client.get(path) assert response.status_code == 422 assert response.json() == { "detail": [ { "type": "missing", "loc": ["query", "p"], "msg": "Field required",
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Sat Dec 27 18:19:10 UTC 2025 - 9.9K bytes - Viewed (0) -
tests/test_tutorial/test_security/test_tutorial003.py
assert response.status_code == 400, response.text assert response.json() == {"detail": "Incorrect username or password"} def test_no_token(client: TestClient): response = client.get("/users/me") assert response.status_code == 401, response.text assert response.json() == {"detail": "Not authenticated"} assert response.headers["WWW-Authenticate"] == "Bearer"Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Sat Dec 27 18:19:10 UTC 2025 - 7.7K bytes - Viewed (0) -
tests/test_tutorial/test_security/test_tutorial006.py
assert response.status_code == 200, response.text assert response.json() == {"username": "john", "password": "secret"} def test_security_http_basic_no_credentials(client: TestClient): response = client.get("/users/me") assert response.json() == {"detail": "Not authenticated"} assert response.status_code == 401, response.text assert response.headers["WWW-Authenticate"] == "Basic"Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Wed Dec 17 20:41:43 UTC 2025 - 2.6K bytes - Viewed (0) -
tests/test_validation_error_context.py
assert captured_exception.exception is not None error_str = str(captured_exception.exception) assert "subapp_websocket_endpoint" in error_str assert "/sub/ws/" in error_str def test_validation_error_with_only_path(): errors = [{"type": "missing", "loc": ("body", "name"), "msg": "Field required"}] exc = RequestValidationError(errors, endpoint_ctx={"path": "GET /api/test"}) error_str = str(exc)Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Sat Dec 06 12:21:57 UTC 2025 - 4.7K bytes - Viewed (0) -
docs_src/app_testing/app_b_an_py39/test_main.py
assert response.status_code == 200 assert response.json() == { "id": "foo", "title": "Foo", "description": "There goes my hero", } def test_read_item_bad_token(): response = client.get("/items/foo", headers={"X-Token": "hailhydra"}) assert response.status_code == 400 assert response.json() == {"detail": "Invalid X-Token header"}Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Thu Aug 15 22:31:16 UTC 2024 - 1.8K bytes - Viewed (0) -
tests/test_request_params/test_form/test_required_str.py
@pytest.mark.parametrize( "path", ["/required-str", "/model-required-str"], ) def test_required_str_missing(path: str): client = TestClient(app) response = client.post(path) assert response.status_code == 422 assert response.json() == { "detail": [ { "type": "missing", "loc": ["body", "p"], "msg": "Field required",
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Sat Dec 27 18:19:10 UTC 2025 - 10.6K bytes - Viewed (0) -
tests/test_request_params/test_header/test_list.py
@pytest.mark.parametrize( "path", ["/required-list-str", "/model-required-list-str"], ) def test_required_list_str_missing(path: str): client = TestClient(app) response = client.get(path) assert response.status_code == 422 assert response.json() == { "detail": [ { "type": "missing", "loc": ["header", "p"], "msg": "Field required",
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Sat Dec 27 18:31:34 UTC 2025 - 11K bytes - Viewed (0)