Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 40 for mod_name (0.05 sec)

  1. tests/test_tutorial/test_debugging/test_tutorial001.py

    import pytest
    from fastapi.testclient import TestClient
    
    MOD_NAME = "docs_src.debugging.tutorial001_py39"
    
    
    @pytest.fixture(name="client")
    def get_client():
        mod = importlib.import_module(MOD_NAME)
        client = TestClient(mod.app)
        return client
    
    
    def test_uvicorn_run_is_not_called_on_import():
        if sys.modules.get(MOD_NAME):
            del sys.modules[MOD_NAME]  # pragma: no cover
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Fri Dec 26 10:43:02 UTC 2025
    - 1.8K bytes
    - Viewed (0)
  2. tests/test_tutorial/test_settings/test_app01.py

        main_mod = importlib.import_module(mod_name)
        return TestClient(main_mod.app)
    
    
    def test_settings_validation_error(mod_name: str, monkeypatch: MonkeyPatch):
        monkeypatch.delenv("ADMIN_EMAIL", raising=False)
        if mod_name in sys.modules:
            del sys.modules[mod_name]  # pragma: no cover
    
        with pytest.raises(ValidationError) as exc_info:
            importlib.import_module(mod_name)
        assert exc_info.value.errors() == [
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Fri Dec 26 10:43:02 UTC 2025
    - 2.2K bytes
    - Viewed (0)
  3. tests/test_tutorial/test_path_operation_configurations/test_tutorial003_tutorial004.py

            "description": "Item description",
            "price": 42.0,
            "tax": 3.2,
            "tags": IsList("bar", "baz", check_order=False),
        }
    
    
    def test_openapi_schema(client: TestClient, mod_name: str):
        mod_name = mod_name[:11]
    
        response = client.get("/openapi.json")
        assert response.status_code == 200, response.text
        assert response.json() == {
            "openapi": "3.1.0",
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Fri Dec 26 10:43:02 UTC 2025
    - 7K bytes
    - Viewed (0)
  4. tests/test_tutorial/test_body_nested_models/test_tutorial001_tutorial002_tutorial003.py

        return request.param
    
    
    @pytest.fixture(name="client")
    def get_client(mod_name: str):
        mod = importlib.import_module(f"docs_src.body_nested_models.{mod_name}")
    
        client = TestClient(mod.app)
        return client
    
    
    def test_put_all(client: TestClient, mod_name: str):
        if mod_name.startswith("tutorial003"):
            tags_expected = IsList("foo", "bar", check_order=False)
        else:
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Fri Dec 26 10:43:02 UTC 2025
    - 7.9K bytes
    - Viewed (0)
  5. tests/test_tutorial/test_custom_response/test_tutorial002_tutorial003_tutorial004.py

    
    @pytest.fixture(
        name="mod_name",
        params=[
            pytest.param("tutorial002_py39"),
            pytest.param("tutorial003_py39"),
            pytest.param("tutorial004_py39"),
        ],
    )
    def get_mod_name(request: pytest.FixtureRequest) -> str:
        return request.param
    
    
    @pytest.fixture(name="client")
    def get_client(mod_name: str) -> TestClient:
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Fri Dec 26 10:43:02 UTC 2025
    - 1.8K bytes
    - Viewed (0)
  6. tests/test_tutorial/test_dependencies/test_tutorial008.py

            pytest.param("tutorial008_an_py39", marks=pytest.mark.xfail),
        ],
    )
    def get_module(request: pytest.FixtureRequest):
        mod_name = f"docs_src.dependencies.{request.param}"
        mod = importlib.import_module(mod_name)
        return mod
    
    
    def test_get_db(module: ModuleType):
        app = FastAPI()
    
        @app.get("/")
        def read_root(c: Annotated[Any, Depends(module.dependency_c)]):
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Fri Dec 26 10:43:02 UTC 2025
    - 1.4K bytes
    - Viewed (0)
  7. docs_src/path_params/tutorial005_py39.py

    
    class ModelName(str, Enum):
        alexnet = "alexnet"
        resnet = "resnet"
        lenet = "lenet"
    
    
    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":
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 546 bytes
    - Viewed (0)
  8. 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)
  9. src/main/java/org/codelibs/fess/opensearch/query/StoredLtrQueryBuilder.java

         * @return The model name.
         */
        public String modelName() {
            return modelName;
        }
    
        /**
         * Sets the name of the LTR model.
         *
         * @param modelName The model name.
         * @return This query builder.
         */
        public StoredLtrQueryBuilder modelName(final String modelName) {
            this.modelName = Objects.requireNonNull(modelName);
            return this;
        }
    
        /**
    Registered: Sat Dec 20 09:19:18 UTC 2025
    - Last Modified: Thu Jul 17 08:28:31 UTC 2025
    - 7.6K bytes
    - Viewed (0)
  10. docs/de/docs/tutorial/path-params.md

    Sie können ihn mit einem Member Ihrer Enumeration `ModelName` vergleichen:
    
    {* ../../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`:
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 10.5K bytes
    - Viewed (0)
Back to top