Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 17 for Configuration (0.21 sec)

  1. tests/test_tutorial/test_path_operation_advanced_configurations/test_tutorial003.py

    from fastapi.testclient import TestClient
    
    from docs_src.path_operation_advanced_configuration.tutorial003 import app
    
    client = TestClient(app)
    
    
    def test_get():
        response = client.get("/items/")
        assert response.status_code == 200, response.text
        assert response.json() == [{"item_id": "Foo"}]
    
    
    def test_openapi_schema():
        response = client.get("/openapi.json")
        assert response.status_code == 200, response.text
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jun 30 18:25:16 GMT 2023
    - 575 bytes
    - Viewed (0)
  2. tests/test_tutorial/test_path_operation_configurations/test_tutorial006.py

    import pytest
    from fastapi.testclient import TestClient
    
    from docs_src.path_operation_configuration.tutorial006 import app
    
    client = TestClient(app)
    
    
    @pytest.mark.parametrize(
        "path,expected_status,expected_response",
        [
            ("/items/", 200, [{"name": "Foo", "price": 42}]),
            ("/users/", 200, [{"username": "johndoe"}]),
            ("/elements/", 200, [{"item_id": "Foo"}]),
        ],
    )
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jun 30 18:25:16 GMT 2023
    - 2.3K bytes
    - Viewed (0)
  3. tests/test_tutorial/test_path_operation_advanced_configurations/test_tutorial001.py

    from fastapi.testclient import TestClient
    
    from docs_src.path_operation_advanced_configuration.tutorial001 import app
    
    client = TestClient(app)
    
    
    def test_get():
        response = client.get("/items/")
        assert response.status_code == 200, response.text
        assert response.json() == [{"item_id": "Foo"}]
    
    
    def test_openapi_schema():
        response = client.get("/openapi.json")
        assert response.status_code == 200, response.text
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jun 30 18:25:16 GMT 2023
    - 1K bytes
    - Viewed (0)
  4. tests/test_tutorial/test_path_operation_advanced_configurations/test_tutorial005.py

    from fastapi.testclient import TestClient
    
    from docs_src.path_operation_advanced_configuration.tutorial005 import app
    
    client = TestClient(app)
    
    
    def test_get():
        response = client.get("/items/")
        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() == {
            "openapi": "3.1.0",
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jun 30 18:25:16 GMT 2023
    - 1K bytes
    - Viewed (0)
  5. tests/test_tutorial/test_path_operation_advanced_configurations/test_tutorial004.py

    from fastapi.testclient import TestClient
    
    from docs_src.path_operation_advanced_configuration.tutorial004 import app
    
    from ...utils import needs_pydanticv1, needs_pydanticv2
    
    client = TestClient(app)
    
    
    def test_query_params_str_validations():
        response = client.post("/items/", json={"name": "Foo", "price": 42})
        assert response.status_code == 200, response.text
        assert response.json() == {
            "name": "Foo",
            "price": 42,
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Sep 28 04:14:40 GMT 2023
    - 8.7K bytes
    - Viewed (0)
  6. fastapi/applications.py

            swagger_ui_init_oauth: Annotated[
                Optional[Dict[str, Any]],
                Doc(
                    """
                    OAuth2 configuration for the Swagger UI, by default shown at `/docs`.
    
                    Read more about the available configuration options in the
                    [Swagger UI docs](https://swagger.io/docs/open-source-tools/swagger-ui/usage/oauth2/).
                    """
                ),
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Tue Apr 02 02:48:51 GMT 2024
    - 172.2K bytes
    - Viewed (0)
  7. fastapi/routing.py

                    It will be added to the generated OpenAPI (e.g. visible at `/docs`).
    
                    Read more about it in the
                    [FastAPI docs for Path Operation Configuration](https://fastapi.tiangolo.com/tutorial/path-operation-configuration/).
                    """
                ),
            ] = None,
            dependencies: Annotated[
                Optional[Sequence[params.Depends]],
                Doc(
                    """
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Tue Apr 02 02:48:51 GMT 2024
    - 170.1K bytes
    - Viewed (0)
  8. tests/test_tutorial/test_path_operation_advanced_configurations/test_tutorial006.py

    from fastapi.testclient import TestClient
    
    from docs_src.path_operation_advanced_configuration.tutorial006 import app
    
    client = TestClient(app)
    
    
    def test_post():
        response = client.post("/items/", content=b"this is actually not validated")
        assert response.status_code == 200, response.text
        assert response.json() == {
            "size": 30,
            "content": {
                "name": "Maaaagic",
                "price": 42,
    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)
  9. tests/test_tutorial/test_path_operation_advanced_configurations/test_tutorial002.py

    from fastapi.testclient import TestClient
    
    from docs_src.path_operation_advanced_configuration.tutorial002 import app
    
    client = TestClient(app)
    
    
    def test_get():
        response = client.get("/items/")
        assert response.status_code == 200, response.text
        assert response.json() == [{"item_id": "Foo"}]
    
    
    def test_openapi_schema():
        response = client.get("/openapi.json")
        assert response.status_code == 200, response.text
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jun 30 18:25:16 GMT 2023
    - 1020 bytes
    - Viewed (0)
  10. tests/test_tutorial/test_path_operation_advanced_configurations/test_tutorial007_pv1.py

    import pytest
    from fastapi.testclient import TestClient
    
    from ...utils import needs_pydanticv1
    
    
    @pytest.fixture(name="client")
    def get_client():
        from docs_src.path_operation_advanced_configuration.tutorial007_pv1 import app
    
        client = TestClient(app)
        return client
    
    
    @needs_pydanticv1
    def test_post(client: TestClient):
        yaml_data = """
            name: Deadpoolio
            tags:
            - x-force
            - x-men
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jul 07 17:12:13 GMT 2023
    - 3.2K bytes
    - Viewed (0)
Back to top