Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 122 for Sample (0.17 sec)

  1. tests/test_schema_extra_examples.py

            @app.get("/path_example_examples/{item_id}")
            def path_example_examples(
                item_id: str = Path(
                    example="item_overridden",
                    examples=["item_1", "item_2"],
                ),
            ):
                return item_id
    
        with pytest.warns(DeprecationWarning):
    
            @app.get("/query_example/")
            def query_example(
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Tue Oct 24 20:26:06 GMT 2023
    - 37.7K bytes
    - Viewed (0)
  2. tests/test_response_model_data_filter_no_inheritance.py

        response = client.post(
            "/users", json={"email": "johndoe@example.com", "password": "secret"}
        )
        assert response.json() == {"email": "johndoe@example.com"}
    
    
    def test_filter_second_level_model():
        response = client.get("/pets/1")
        assert response.json() == {
            "name": "Nibbler",
            "owner": {"email": "johndoe@example.com"},
        }
    
    
    def test_list_of_models():
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jul 07 17:12:13 GMT 2023
    - 1.7K bytes
    - Viewed (0)
  3. tests/test_tutorial/test_behind_a_proxy/test_tutorial003.py

                    "url": IsOneOf(
                        "https://stag.example.com/",
                        # TODO: remove when deprecating Pydantic v1
                        "https://stag.example.com",
                    ),
                    "description": "Staging environment",
                },
                {
                    "url": IsOneOf(
                        "https://prod.example.com/",
                        # TODO: remove when deprecating Pydantic v1
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jul 07 17:12:13 GMT 2023
    - 1.6K bytes
    - Viewed (0)
  4. tests/test_security_http_basic_realm_description.py

        assert response.headers["WWW-Authenticate"] == 'Basic realm="simple"'
    
    
    def test_security_http_basic_invalid_credentials():
        response = client.get(
            "/users/me", headers={"Authorization": "Basic notabase64token"}
        )
        assert response.status_code == 401, response.text
        assert response.headers["WWW-Authenticate"] == 'Basic realm="simple"'
        assert response.json() == {"detail": "Invalid authentication credentials"}
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jun 30 18:25:16 GMT 2023
    - 2.8K bytes
    - Viewed (0)
  5. docs_src/sql_databases/sql_app_py39/tests/test_sql_app.py

    client = TestClient(app)
    
    
    def test_create_user():
        response = client.post(
            "/users/",
            json={"email": "deadpool@example.com", "password": "chimichangas4life"},
        )
        assert response.status_code == 200, response.text
        data = response.json()
        assert data["email"] == "deadpool@example.com"
        assert "id" in data
        user_id = data["id"]
    
        response = client.get(f"/users/{user_id}")
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jan 07 14:11:31 GMT 2022
    - 1.2K bytes
    - Viewed (0)
  6. tests/test_tutorial/test_metadata/test_tutorial001.py

                "termsOfService": "http://example.com/terms/",
                "contact": {
                    "name": "Deadpoolio the Amazing",
                    "url": "http://x-force.example.com/contact/",
                    "email": "dp@x-force.example.com",
                },
                "license": {
                    "name": "Apache 2.0",
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jun 30 18:25:16 GMT 2023
    - 1.7K bytes
    - Viewed (0)
  7. tests/test_tutorial/test_settings/test_tutorial001.py

    def test_settings(monkeypatch: MonkeyPatch):
        monkeypatch.setenv("ADMIN_EMAIL", "admin@example.com")
        from docs_src.settings.tutorial001 import app
    
        client = TestClient(app)
        response = client.get("/info")
        assert response.status_code == 200, response.text
        assert response.json() == {
            "app_name": "Awesome API",
            "admin_email": "admin@example.com",
            "items_per_user": 50,
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jul 07 17:12:13 GMT 2023
    - 552 bytes
    - Viewed (0)
  8. tests/test_tutorial/test_background_tasks/test_tutorial002.py

        if log.is_file():
            os.remove(log)  # pragma: no cover
        response = client.post("/send-notification/foo@example.com?q=some-query")
        assert response.status_code == 200, response.text
        assert response.json() == {"message": "Message sent"}
        with open("./log.txt") as f:
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Jul 09 18:06:12 GMT 2020
    - 568 bytes
    - Viewed (0)
  9. tests/test_tutorial/test_schema_extra_example/test_tutorial001_py310.py

    from ...utils import needs_py310, needs_pydanticv2
    
    
    @pytest.fixture(name="client")
    def get_client():
        from docs_src.schema_extra_example.tutorial001_py310 import app
    
        client = TestClient(app)
        return client
    
    
    @needs_py310
    @needs_pydanticv2
    def test_post_body_example(client: TestClient):
        response = client.put(
            "/items/5",
            json={
                "name": "Foo",
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jul 07 17:12:13 GMT 2023
    - 4.7K bytes
    - Viewed (0)
  10. tests/test_tutorial/test_response_model/test_tutorial003.py

            json={
                "username": "foo",
                "password": "fighter",
                "email": "foo@example.com",
                "full_name": "Grave Dohl",
            },
        )
        assert response.status_code == 200, response.text
        assert response.json() == {
            "username": "foo",
            "email": "foo@example.com",
            "full_name": "Grave Dohl",
        }
    
    
    def test_openapi_schema():
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Aug 04 20:47:07 GMT 2023
    - 5.6K bytes
    - Viewed (0)
Back to top