Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 20 of 314 for error (0.17 sec)

  1. tests/test_tutorial/test_dependencies/test_tutorial008d_an_py39.py

    
    @needs_py39
    def test_internal_error(client: TestClient):
        from docs_src.dependencies.tutorial008d_an_py39 import InternalError
    
        with pytest.raises(InternalError) as exc_info:
            client.get("/items/portal-gun")
        assert (
            exc_info.value.args[0] == "The portal gun is too dangerous to be owned by Rick"
        )
    
    
    @needs_py39
    def test_internal_server_error():
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Feb 24 23:06:37 GMT 2024
    - 1.3K bytes
    - Viewed (0)
  2. tests/test_additional_responses_response_class.py

    
    class JsonApiResponse(JSONResponse):
        media_type = "application/vnd.api+json"
    
    
    class Error(BaseModel):
        status: str
        title: str
    
    
    class JsonApiError(BaseModel):
        errors: typing.List[Error]
    
    
    @app.get(
        "/a",
        response_class=JsonApiResponse,
        responses={500: {"description": "Error", "model": JsonApiError}},
    )
    async def a():
        pass  # pragma: no cover
    
    
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jun 30 18:25:16 GMT 2023
    - 3.5K bytes
    - Viewed (0)
  3. tests/test_tutorial/test_request_files/test_tutorial001.py

    client = TestClient(app)
    
    
    file_required = {
        "detail": [
            {
                "loc": ["body", "file"],
                "msg": "field required",
                "type": "value_error.missing",
            }
        ]
    }
    
    
    def test_post_form_no_body():
        response = client.post("/files/")
        assert response.status_code == 422, response.text
        assert response.json() == IsDict(
            {
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 7.7K bytes
    - Viewed (0)
  4. tests/test_tutorial/test_dependencies/test_tutorial012_an_py39.py

                        "loc": ["header", "x-token"],
                        "msg": "field required",
                        "type": "value_error.missing",
                    },
                    {
                        "loc": ["header", "x-key"],
                        "msg": "field required",
                        "type": "value_error.missing",
                    },
                ]
            }
        )
    
    
    @needs_py39
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 8.8K bytes
    - Viewed (0)
  5. tests/test_security_oauth2_optional_description.py

                        "loc": ["body", "grant_type"],
                        "msg": "field required",
                        "type": "value_error.missing",
                    },
                    {
                        "loc": ["body", "username"],
                        "msg": "field required",
                        "type": "value_error.missing",
                    },
                    {
                        "loc": ["body", "password"],
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 10.9K bytes
    - Viewed (0)
  6. tests/test_tutorial/test_handling_errors/test_tutorial001.py

        assert response.json() == {"detail": "Item not found"}
    
    
    def test_openapi_schema():
        response = client.get("/openapi.json")
        assert response.status_code == 200, response.text
        assert response.json() == {
            "openapi": "3.1.0",
            "info": {"title": "FastAPI", "version": "0.1.0"},
            "paths": {
                "/items/{item_id}": {
                    "get": {
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jun 30 18:25:16 GMT 2023
    - 3.2K bytes
    - Viewed (0)
  7. fastapi/openapi/docs.py

                    } else {
                        let oauthErrorMsg;
                        if (qp.error) {
                            oauthErrorMsg = "["+qp.error+"]: " +
                                (qp.error_description ? qp.error_description+ ". " : "no accessCode received from the server. ") +
                                (qp.error_uri ? "More info: "+qp.error_uri : "");
                        }
    
                        oauth2.errCb({
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Tue Apr 02 02:48:51 GMT 2024
    - 10.1K bytes
    - Viewed (0)
  8. tests/test_tutorial/test_body_multiple_params/test_tutorial003_an_py310.py

                        "loc": ["body", "item"],
                        "msg": "field required",
                        "type": "value_error.missing",
                    },
                    {
                        "loc": ["body", "user"],
                        "msg": "field required",
                        "type": "value_error.missing",
                    },
                    {
                        "loc": ["body", "importance"],
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 9.5K bytes
    - Viewed (0)
  9. docs/sts/web-identity.py

                  "scope": "openid"}
    
        url = authorize_url + "?" + urllib.parse.urlencode(params)
        return url
    
    
    @app.route('/oauth2/callback')
    def callback():
        error = request.args.get('error', '')
        if error:
            return "Error: " + error
    
        authorization_code = request.args.get('code')
    
        data = {'grant_type': 'authorization_code',
                'code': authorization_code, 'redirect_uri': callback_uri}
    Python
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Wed Jul 28 01:37:51 GMT 2021
    - 2.9K bytes
    - Viewed (1)
  10. tests/test_extra_routes.py

                                "content": {"application/json": {"schema": {}}},
                            },
                            "422": {
                                "description": "Validation Error",
                                "content": {
                                    "application/json": {
                                        "schema": {
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jul 07 17:12:13 GMT 2023
    - 13.7K bytes
    - Viewed (0)
Back to top