Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 121 for switch (0.29 sec)

  1. tests/test_router_prefix_with_template.py

    Samuel Colvin <******@****.***> 1586320658 +0100
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Wed Apr 08 04:37:38 GMT 2020
    - 484 bytes
    - Viewed (0)
  2. tests/test_tutorial/test_websockets/test_tutorial002_py310.py

        assert response.status_code == 200, response.text
        assert b"<!DOCTYPE html>" in response.content
    
    
    @needs_py310
    def test_websocket_with_cookie(app: FastAPI):
        client = TestClient(app, cookies={"session": "fakesession"})
        with pytest.raises(WebSocketDisconnect):
            with client.websocket_connect("/items/foo/ws") as websocket:
                message = "Message one"
                websocket.send_text(message)
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Mar 18 12:29:59 GMT 2023
    - 3.9K bytes
    - Viewed (0)
  3. tests/test_tutorial/test_testing_dependencies/test_tutorial001_py310.py

    
    @needs_py310
    def test_override_in_items_with_q_run():
        from docs_src.dependency_testing.tutorial001_py310 import (
            test_override_in_items_with_q,
        )
    
        test_override_in_items_with_q()
    
    
    @needs_py310
    def test_override_in_items_with_params_run():
        from docs_src.dependency_testing.tutorial001_py310 import (
            test_override_in_items_with_params,
        )
    
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Mar 18 12:29:59 GMT 2023
    - 2K bytes
    - Viewed (0)
  4. docs_src/body/tutorial002_py310.py

        tax: float | None = None
    
    
    app = FastAPI()
    
    
    @app.post("/items/")
    async def create_item(item: Item):
        item_dict = item.dict()
        if item.tax:
            price_with_tax = item.price + item.tax
            item_dict.update({"price_with_tax": price_with_tax})
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Jan 07 14:11:31 GMT 2022
    - 429 bytes
    - Viewed (0)
  5. tests/test_validate_response.py

            {"name": "bar", "price": "bar"},
            {"name": "baz", "price": "baz"},
        ]
    
    
    client = TestClient(app)
    
    
    def test_invalid():
        with pytest.raises(ResponseValidationError):
            client.get("/items/invalid")
    
    
    def test_invalid_none():
        with pytest.raises(ResponseValidationError):
            client.get("/items/invalidnone")
    
    
    def test_valid_none_data():
        response = client.get("/items/validnone")
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jul 07 17:12:13 GMT 2023
    - 2K bytes
    - Viewed (0)
  6. fastapi/security/oauth2.py

            ],
            scope: Annotated[
                str,
                Form(),
                Doc(
                    """
                    A single string with actually several scopes separated by spaces. Each
                    scope is also a string.
    
                    For example, a single string with:
    
                    ```python
                    "items:read items:write users:read profile openid"
                    ````
    
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Tue Apr 02 02:48:51 GMT 2024
    - 21.1K bytes
    - Viewed (1)
  7. tests/test_tutorial/test_response_model/test_tutorial003_03.py

    
    def test_get_portal():
        response = client.get("/teleport", follow_redirects=False)
        assert response.status_code == 307, response.text
        assert response.headers["location"] == "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
    
    
    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.1K bytes
    - Viewed (0)
  8. tests/test_ws_dependencies.py

    )
    
    
    def test_index():
        client = TestClient(app)
        with client.websocket_connect("/") as websocket:
            data = json.loads(websocket.receive_text())
            assert data == ["app", "index"]
    
    
    def test_routerindex():
        client = TestClient(app)
        with client.websocket_connect("/router") as websocket:
            data = json.loads(websocket.receive_text())
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sun Jun 11 20:35:39 GMT 2023
    - 2.1K bytes
    - Viewed (0)
  9. tests/test_tutorial/test_body/test_tutorial001_py310.py

        }
    
    
    @needs_py310
    def test_post_with_str_float(client: TestClient):
        response = client.post("/items/", json={"name": "Foo", "price": "50.5"})
        assert response.status_code == 200
        assert response.json() == {
            "name": "Foo",
            "price": 50.5,
            "description": None,
            "tax": None,
        }
    
    
    @needs_py310
    def test_post_with_str_float_description(client: TestClient):
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 15K bytes
    - Viewed (1)
  10. tests/test_tutorial/test_body/test_tutorial001.py

            "tax": None,
        }
    
    
    def test_post_with_str_float(client: TestClient):
        response = client.post("/items/", json={"name": "Foo", "price": "50.5"})
        assert response.status_code == 200
        assert response.json() == {
            "name": "Foo",
            "price": 50.5,
            "description": None,
            "tax": None,
        }
    
    
    def test_post_with_str_float_description(client: TestClient):
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 14.7K bytes
    - Viewed (5)
Back to top