Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 20 of 37 for get_settings (0.06 sec)

  1. tests/test_tutorial/test_settings/test_app02.py

        test_main_mod = importlib.import_module(f"{mod_path}.test_main")
        return test_main_mod
    
    
    def test_settings(main_mod: ModuleType, monkeypatch: MonkeyPatch):
        monkeypatch.setenv("ADMIN_EMAIL", "******@****.***")
        settings = main_mod.get_settings()
        assert settings.app_name == "Awesome API"
        assert settings.items_per_user == 50
    
    
    def test_override_settings(test_main_mod: ModuleType):
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 20 15:55:38 UTC 2025
    - 1K bytes
    - Viewed (0)
  2. tests/test_tutorial/test_settings/test_app03.py

    def get_main_mod(mod_path: str) -> ModuleType:
        main_mod = importlib.import_module(f"{mod_path}.main")
        return main_mod
    
    
    def test_settings(main_mod: ModuleType, monkeypatch: MonkeyPatch):
        monkeypatch.setenv("ADMIN_EMAIL", "******@****.***")
        settings = main_mod.get_settings()
        assert settings.app_name == "Awesome API"
        assert settings.admin_email == "******@****.***"
        assert settings.items_per_user == 50
    
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 12:54:56 UTC 2025
    - 1.2K bytes
    - Viewed (0)
  3. docs/en/docs/advanced/settings.md

    {* ../../docs_src/settings/app03_an_py39/main.py hl[1,11] *}
    
    Then for any subsequent call of `get_settings()` in the dependencies for the next requests, instead of executing the internal code of `get_settings()` and creating a new `Settings` object, it will return the same object that was returned on the first call, again and again.
    
    #### `lru_cache` Technical Details { #lru-cache-technical-details }
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 20 15:55:38 UTC 2025
    - 11.2K bytes
    - Viewed (0)
  4. docs/zh/docs/advanced/settings.md

    如果依赖项函数只是这样的:
    
    ```Python
    def get_settings():
        return Settings()
    ```
    
    我们将为每个请求创建该对象,并且将在每个请求中读取 `.env` 文件。 ⚠️
    
    但是,由于我们在顶部使用了 `@lru_cache` 装饰器,因此只有在第一次调用它时,才会创建 `Settings` 对象一次。 ✔️
    
    {* ../../docs_src/settings/app03_an_py39/main.py hl[1,11] *}
    
    然后,在下一次请求的依赖项中对 `get_settings()` 进行任何后续调用时,它不会执行 `get_settings()` 的内部代码并创建新的 `Settings` 对象,而是返回在第一次调用时返回的相同对象,一次又一次。
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Mon Nov 18 02:25:44 UTC 2024
    - 12.7K bytes
    - Viewed (0)
  5. src/main/java/org/codelibs/fess/suggest/settings/AnalyzerSettings.java

            final Settings settings = response.getIndexToSettings().get(analyzerSettingsIndexName);
            final Settings analyzerSettings = settings.getAsSettings("index.analysis.analyzer");
            return analyzerSettings.getAsGroups().keySet();
        }
    
        /**
         * Get field analyzer mapping.
         * @return Field analyzer mapping
         */
    Registered: Sat Dec 20 13:04:59 UTC 2025
    - Last Modified: Thu Aug 07 02:41:28 UTC 2025
    - 26.5K bytes
    - Viewed (0)
  6. compat/maven-settings-builder/src/test/java/org/apache/maven/settings/building/DefaultSettingsBuilderFactoryTest.java

    import java.io.File;
    
    import org.junit.jupiter.api.Test;
    
    import static org.junit.jupiter.api.Assertions.assertNotNull;
    
    /**
     */
    class DefaultSettingsBuilderFactoryTest {
    
        private File getSettings(String name) {
            return new File("src/test/resources/settings/factory/" + name + ".xml").getAbsoluteFile();
        }
    
        @Test
        void testCompleteWiring() throws Exception {
    Registered: Sun Dec 28 03:35:09 UTC 2025
    - Last Modified: Fri Oct 25 12:31:46 UTC 2024
    - 1.7K bytes
    - Viewed (0)
  7. src/main/java/org/codelibs/fess/sso/saml/SamlAuthenticator.java

                }
                final HttpServletResponse response = LaResponseUtil.getResponse();
                try {
                    final Auth auth = new Auth(getSettings(), request, response);
                    final Saml2Settings settings = auth.getSettings();
                    settings.setSPValidationOnly(true);
                    final String metadata = settings.getSPMetadata();
    Registered: Sat Dec 20 09:19:18 UTC 2025
    - Last Modified: Sun Dec 14 01:18:25 UTC 2025
    - 20.2K bytes
    - Viewed (3)
  8. impl/maven-core/src/main/java/org/apache/maven/plugin/PluginParameterExpressionEvaluator.java

                        value = ReflectionValueExtractor.evaluate(pathExpression, session.getSettings());
                        value = value + expression.substring(pathSeparator);
                    } else {
                        value = ReflectionValueExtractor.evaluate(expression, session.getSettings());
                    }
                } catch (Exception e) {
                    // TODO don't catch exception
    Registered: Sun Dec 28 03:35:09 UTC 2025
    - Last Modified: Fri Jan 24 17:29:44 UTC 2025
    - 16.6K bytes
    - Viewed (0)
  9. impl/maven-core/src/main/java/org/apache/maven/internal/impl/DefaultSession.java

            return repositories == null ? null : map(repositories, this::toArtifactRepository);
        }
    
        @Nonnull
        @Override
        public Settings getSettings() {
            return getMavenSession().getSettings().getDelegate();
        }
    
        @Nonnull
        @Override
        public Collection<ToolchainModel> getToolchains() {
            return getMavenSession().getRequest().getToolchains().values().stream()
    Registered: Sun Dec 28 03:35:09 UTC 2025
    - Last Modified: Fri Jun 06 14:28:57 UTC 2025
    - 8.9K bytes
    - Viewed (0)
  10. tests/test_tutorial/test_settings/test_tutorial001.py

        monkeypatch.setenv("ADMIN_EMAIL", "******@****.***")
        mod = importlib.import_module(f"docs_src.settings.{request.param}")
        return mod.app
    
    
    def test_settings(app):
        client = TestClient(app)
        response = client.get("/info")
        assert response.status_code == 200, response.text
        assert response.json() == {
            "app_name": "Awesome API",
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 12:54:56 UTC 2025
    - 690 bytes
    - Viewed (0)
Back to top