Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 314 for Errorf (0.26 sec)

  1. tests/test_tutorial/test_custom_request_and_route/test_tutorial002.py

            {
                "detail": {
                    "body": '{"numbers": [1, 2, 3]}',
                    "errors": [
                        {
                            "loc": ["body"],
                            "msg": "value is not a valid list",
                            "type": "type_error.list",
                        }
                    ],
                }
            }
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 1.2K bytes
    - Viewed (0)
  2. tests/test_tutorial/test_handling_errors/test_tutorial006.py

    from dirty_equals import IsDict
    from fastapi.testclient import TestClient
    
    from docs_src.handling_errors.tutorial006 import app
    
    client = TestClient(app)
    
    
    def test_get_validation_error():
        response = client.get("/items/foo")
        assert response.status_code == 422, response.text
        assert response.json() == IsDict(
            {
                "detail": [
                    {
                        "type": "int_parsing",
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 4K bytes
    - Viewed (0)
  3. tests/test_tutorial/test_handling_errors/test_tutorial001.py

    from fastapi.testclient import TestClient
    
    from docs_src.handling_errors.tutorial001 import app
    
    client = TestClient(app)
    
    
    def test_get_item():
        response = client.get("/items/foo")
        assert response.status_code == 200, response.text
        assert response.json() == {"item": "The Foo Wrestlers"}
    
    
    def test_get_item_not_found():
        response = client.get("/items/bar")
        assert response.status_code == 404, response.text
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Fri Jun 30 18:25:16 GMT 2023
    - 3.2K bytes
    - Viewed (0)
  4. tests/test_filter_pydantic_sub_model_pv2.py

            client.get("/model/modelX")
        assert err.value.errors() == [
            IsDict(
                {
                    "type": "value_error",
                    "loc": ("response", "name"),
                    "msg": "Value error, name must end in A",
                    "input": "modelX",
                    "ctx": {"error": HasRepr("ValueError('name must end in A')")},
                }
            )
            | IsDict(
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 6.3K bytes
    - Viewed (0)
  5. tests/test_tutorial/test_handling_errors/test_tutorial003.py

    from fastapi.testclient import TestClient
    
    from docs_src.handling_errors.tutorial003 import app
    
    client = TestClient(app)
    
    
    def test_get():
        response = client.get("/unicorns/shinny")
        assert response.status_code == 200, response.text
        assert response.json() == {"unicorn_name": "shinny"}
    
    
    def test_get_exception():
        response = client.get("/unicorns/yolo")
        assert response.status_code == 418, response.text
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Fri Jun 30 18:25:16 GMT 2023
    - 3.2K bytes
    - Viewed (0)
  6. tests/test_exception_handlers.py

    
    def test_override_server_error_exception_raises():
        with pytest.raises(RuntimeError):
            client.get("/server-error")
    
    
    def test_override_server_error_exception_response():
        client = TestClient(app, raise_server_exceptions=False)
        response = client.get("/server-error")
        assert response.status_code == 500
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Thu Feb 17 12:40:12 GMT 2022
    - 1.9K bytes
    - Viewed (0)
  7. tests/test_additional_responses_router.py

    
    @router.get("/a", responses={501: {"description": "Error 1"}})
    async def a():
        return "a"
    
    
    @router.get(
        "/b",
        responses={
            502: {"description": "Error 2"},
            "4XX": {"description": "Error with range, upper"},
        },
    )
    async def b():
        return "b"
    
    
    @router.get(
        "/c",
        responses={
            "400": {"description": "Error with str"},
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Fri Jun 30 18:25:16 GMT 2023
    - 5.1K bytes
    - Viewed (0)
  8. tests/test_tutorial/test_request_forms_and_files/test_tutorial001.py

                        "loc": ["body", "file"],
                        "msg": "field required",
                        "type": "value_error.missing",
                    },
                    {
                        "loc": ["body", "fileb"],
                        "msg": "field required",
                        "type": "value_error.missing",
                    },
                    {
                        "loc": ["body", "token"],
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 9.8K bytes
    - Viewed (0)
  9. 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 21 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 9.5K bytes
    - Viewed (0)
  10. 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 21 19:28:08 GMT 2024
    - Last Modified: Wed Jul 28 01:37:51 GMT 2021
    - 2.9K bytes
    - Viewed (1)
Back to top