Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 14 for test_query (0.13 sec)

  1. tests/test_query.py

    from dirty_equals import IsDict
    from fastapi.testclient import TestClient
    
    from .main import app
    
    client = TestClient(app)
    
    
    def test_query():
        response = client.get("/query")
        assert response.status_code == 422
        assert response.json() == IsDict(
            {
                "detail": [
                    {
                        "type": "missing",
                        "loc": ["query", "query"],
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Thu Apr 18 21:56:59 UTC 2024
    - 11.4K bytes
    - Viewed (0)
  2. src/test/java/org/codelibs/fess/util/QueryStringBuilderTest.java

    import org.codelibs.fess.entity.SearchRequestParams;
    import org.codelibs.fess.unit.UnitFessTestCase;
    
    public class QueryStringBuilderTest extends UnitFessTestCase {
    
        public void test_query() {
            assertEquals("", getQuery("", new String[0], Collections.emptyMap(), Collections.emptyMap(), false));
        }
    
        public void test_conditions_q() {
            final String k = "q";
    Registered: Thu Oct 31 13:40:30 UTC 2024
    - Last Modified: Thu Feb 22 01:37:57 UTC 2024
    - 7K bytes
    - Viewed (0)
  3. docs_src/dependencies/tutorial005_an_py39.py

    
    def query_extractor(q: Union[str, None] = None):
        return q
    
    
    def query_or_cookie_extractor(
        q: Annotated[str, Depends(query_extractor)],
        last_query: Annotated[Union[str, None], Cookie()] = None,
    ):
        if not q:
            return last_query
        return q
    
    
    @app.get("/items/")
    async def read_query(
        query_or_default: Annotated[str, Depends(query_or_cookie_extractor)],
    ):
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Tue Mar 26 16:56:53 UTC 2024
    - 529 bytes
    - Viewed (0)
  4. docs_src/dependencies/tutorial005_an.py

    
    def query_extractor(q: Union[str, None] = None):
        return q
    
    
    def query_or_cookie_extractor(
        q: Annotated[str, Depends(query_extractor)],
        last_query: Annotated[Union[str, None], Cookie()] = None,
    ):
        if not q:
            return last_query
        return q
    
    
    @app.get("/items/")
    async def read_query(
        query_or_default: Annotated[str, Depends(query_or_cookie_extractor)],
    ):
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Tue Mar 26 16:56:53 UTC 2024
    - 558 bytes
    - Viewed (0)
  5. docs_src/dependencies/tutorial005_an_py310.py

    app = FastAPI()
    
    
    def query_extractor(q: str | None = None):
        return q
    
    
    def query_or_cookie_extractor(
        q: Annotated[str, Depends(query_extractor)],
        last_query: Annotated[str | None, Cookie()] = None,
    ):
        if not q:
            return last_query
        return q
    
    
    @app.get("/items/")
    async def read_query(
        query_or_default: Annotated[str, Depends(query_or_cookie_extractor)],
    ):
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Tue Mar 26 16:56:53 UTC 2024
    - 510 bytes
    - Viewed (0)
  6. docs/ru/docs/tutorial/dependencies/sub-dependencies.md

        * Она зависит от `query_extractor` и присваивает возвращаемое ей значение параметру `q`.
    * Она также объявляет необязательный куки-параметр `last_query` в виде строки.
        * Если пользователь не указал параметр `q` в запросе, то мы используем последний использованный запрос, который мы ранее сохранили в куки-параметре `last_query`.
    
    ## Использование зависимости
    
    Затем мы можем использовать зависимость вместе с:
    
    //// tab | Python 3.10+
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 8.7K bytes
    - Viewed (0)
  7. docs/em/docs/tutorial/dependencies/sub-dependencies.md

    ```
    
    ////
    
    ➡️ 🎯 🔛 🔢 📣:
    
    * ✋️ 👉 🔢 🔗 ("☑") ⚫️, ⚫️ 📣 ➕1️⃣ 🔗 (⚫️ "🪀" 🔛 🕳 🙆).
        * ⚫️ 🪀 🔛 `query_extractor`, & 🛠️ 💲 📨 ⚫️ 🔢 `q`.
    * ⚫️ 📣 📦 `last_query` 🍪, `str`.
        * 🚥 👩‍💻 🚫 🚚 🙆 🔢 `q`, 👥 ⚙️ 🏁 🔢 ⚙️, ❔ 👥 🖊 🍪 ⏭.
    
    ## ⚙️ 🔗
    
    ⤴️ 👥 💪 ⚙️ 🔗 ⏮️:
    
    //// tab | 🐍 3️⃣.6️⃣ & 🔛
    
    ```Python hl_lines="22"
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 3.3K bytes
    - Viewed (0)
  8. tests/main.py

        return item_id
    
    
    @app.get("/path/param-le-ge-int/{item_id}")
    def get_path_param_le_ge_int(item_id: int = Path(le=3, ge=1)):
        return item_id
    
    
    @app.get("/query")
    def get_query(query):
        return f"foo bar {query}"
    
    
    @app.get("/query/optional")
    def get_query_optional(query=None):
        if query is None:
            return "foo bar"
        return f"foo bar {query}"
    
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Thu Apr 18 21:56:59 UTC 2024
    - 4.3K bytes
    - Viewed (0)
  9. docs/en/docs/tutorial/dependencies/sub-dependencies.md

        * It depends on the `query_extractor`, and assigns the value returned by it to the parameter `q`.
    * It also declares an optional `last_query` cookie, as a `str`.
        * If the user didn't provide any query `q`, we use the last query used, which we saved to a cookie before.
    
    ## Use the dependency
    
    Then we can use the dependency with:
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 5.5K bytes
    - Viewed (0)
  10. docs/de/docs/tutorial/dependencies/sub-dependencies.md

        * Sie hängt von `query_extractor` ab und weist den von diesem zurückgegebenen Wert dem Parameter `q` zu.
    * Sie deklariert außerdem ein optionales `last_query`-Cookie, ein `str`.
        * Wenn der Benutzer keine Query `q` übermittelt hat, verwenden wir die zuletzt übermittelte Query, die wir zuvor in einem Cookie gespeichert haben.
    
    ## Die Abhängigkeit verwenden
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 6.2K bytes
    - Viewed (0)
Back to top