Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 15 for module_name (0.06 sec)

  1. tests/test_tutorial/test_python_types/test_tutorial001_tutorial002.py

    import runpy
    from unittest.mock import patch
    
    import pytest
    
    
    @pytest.mark.parametrize(
        "module_name",
        [
            "tutorial001_py39",
            "tutorial002_py39",
        ],
    )
    def test_run_module(module_name: str):
        with patch("builtins.print") as mock_print:
            runpy.run_module(f"docs_src.python_types.{module_name}", run_name="__main__")
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Fri Dec 26 10:43:02 UTC 2025
    - 398 bytes
    - Viewed (0)
  2. tests/test_tutorial/test_response_model/test_tutorial003_04.py

    from ...utils import needs_py310
    
    
    @pytest.mark.parametrize(
        "module_name",
        [
            pytest.param("tutorial003_04_py39"),
            pytest.param("tutorial003_04_py310", marks=needs_py310),
        ],
    )
    def test_invalid_response_model(module_name: str) -> None:
        with pytest.raises(FastAPIError):
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 453 bytes
    - Viewed (0)
  3. tests/test_tutorial/test_python_types/test_tutorial011.py

    from ...utils import needs_py310
    
    
    @pytest.mark.parametrize(
        "module_name",
        [
            pytest.param("tutorial011_py39"),
            pytest.param("tutorial011_py310", marks=needs_py310),
        ],
    )
    def test_run_module(module_name: str):
        with patch("builtins.print") as mock_print:
            runpy.run_module(f"docs_src.python_types.{module_name}", run_name="__main__")
    
        assert mock_print.call_count == 2
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Fri Dec 26 10:43:02 UTC 2025
    - 691 bytes
    - Viewed (0)
  4. api/maven-api-core/src/main/java/org/apache/maven/api/JavaPathType.java

             */
            @Nonnull
            private final String moduleName;
    
            /**
             * Creates a new path type for the specified module.
             *
             * @param moduleName name of the module for which a path is specified
             */
            private Modular(@Nonnull String moduleName) {
                this.moduleName = Objects.requireNonNull(moduleName);
            }
    
            /**
    Registered: Sun Dec 28 03:35:09 UTC 2025
    - Last Modified: Mon Dec 15 11:13:42 UTC 2025
    - 15.7K bytes
    - Viewed (1)
  5. docs_src/path_params/tutorial005_py39.py

    
    app = FastAPI()
    
    
    @app.get("/models/{model_name}")
    async def get_model(model_name: ModelName):
        if model_name is ModelName.alexnet:
            return {"model_name": model_name, "message": "Deep Learning FTW!"}
    
        if model_name.value == "lenet":
            return {"model_name": model_name, "message": "LeCNN all the images"}
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 546 bytes
    - Viewed (0)
  6. tests/test_tutorial/test_path_params/test_tutorial005.py

        response = client.get("/models/alexnet")
        assert response.status_code == 200
        assert response.json() == {"model_name": "alexnet", "message": "Deep Learning FTW!"}
    
    
    def test_get_enums_lenet():
        response = client.get("/models/lenet")
        assert response.status_code == 200
        assert response.json() == {"model_name": "lenet", "message": "LeCNN all the images"}
    
    
    def test_get_enums_resnet():
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 18:19:10 UTC 2025
    - 4.1K bytes
    - Viewed (0)
  7. impl/maven-core/src/main/java/org/apache/maven/internal/impl/DefaultProjectManager.java

            boolean validArtifactId = Objects.equals(a1, a2);
            for (SourceRoot sr : getSourceRoots(project)) {
                Optional<String> moduleName = sr.module();
                if (moduleName.isPresent()) {
                    isMultiModule = true;
                    if (moduleName.get().equals(a2)) {
                        validArtifactId = true;
                        break;
                    }
                }
            }
    Registered: Sun Dec 28 03:35:09 UTC 2025
    - Last Modified: Wed Dec 17 16:17:01 UTC 2025
    - 10.9K bytes
    - Viewed (0)
  8. docs/de/docs/tutorial/path-params.md

    {* ../../docs_src/path_params/tutorial005_py39.py hl[17] *}
    
    #### *Enumerations-Wert* erhalten { #get-the-enumeration-value }
    
    Den tatsächlichen Wert (in diesem Fall ein `str`) erhalten Sie via `model_name.value`, oder generell, `your_enum_member.value`:
    
    {* ../../docs_src/path_params/tutorial005_py39.py hl[20] *}
    
    /// tip | Tipp
    
    Sie können den Wert `"lenet"` außerdem mittels `ModelName.lenet.value` abrufen.
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 10.5K bytes
    - Viewed (0)
  9. fastapi/_compat/v2.py

        return error  # type: ignore[return-value]
    
    
    def create_body_model(
        *, fields: Sequence[ModelField], model_name: str
    ) -> type[BaseModel]:
        field_params = {f.name: (f.field_info.annotation, f.field_info) for f in fields}
        BodyModel: type[BaseModel] = create_model(model_name, **field_params)  # type: ignore[call-overload]
        return BodyModel
    
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 12:54:56 UTC 2025
    - 19.1K bytes
    - Viewed (0)
  10. docs/en/docs/tutorial/path-params.md

    {* ../../docs_src/path_params/tutorial005_py39.py hl[17] *}
    
    #### Get the *enumeration value* { #get-the-enumeration-value }
    
    You can get the actual value (a `str` in this case) using `model_name.value`, or in general, `your_enum_member.value`:
    
    {* ../../docs_src/path_params/tutorial005_py39.py hl[20] *}
    
    /// tip
    
    You could also access the value `"lenet"` with `ModelName.lenet.value`.
    
    ///
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 9.2K bytes
    - Viewed (0)
Back to top