Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 1,248 for test_ (0.03 sec)

  1. docs/zh/docs/tutorial/testing.md

    **FastAPI** 提供了和 `starlette.testclient` 一样的 `fastapi.testclient`,只是为了方便开发者。但它直接来自Starlette。
    
    ///
    
    /// tip | "提示"
    
    除了发送请求之外,如果你还想测试时在FastAPI应用中调用 `async` 函数(例如异步数据库函数), 可以在高级教程中看下 [Async Tests](../advanced/async-tests.md){.internal-link target=_blank} 。
    
    ///
    
    ## 分离测试
    
    在实际应用中,你可能会把你的测试放在另一个文件里。
    
    您的**FastAPI**应用程序也可能由一些文件/模块组成等等。
    
    ### **FastAPI** app 文件
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 6K bytes
    - Viewed (0)
  2. docs/pt/docs/tutorial/testing.md

    /// info | "Informação"
    
    Observe que o `TestClient` recebe dados que podem ser convertidos para JSON, não para modelos Pydantic.
    
    Se você tiver um modelo Pydantic em seu teste e quiser enviar seus dados para o aplicativo durante o teste, poderá usar o `jsonable_encoder` descrito em [Codificador compatível com JSON](encoder.md){.internal-link target=_blank}.
    
    ///
    
    ## Execute-o
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 6.9K bytes
    - Viewed (0)
  3. internal/bucket/replication/rule_test.go

    			expectedResult: true,
    		},
    	}
    
    	for i, tc := range testCases {
    		tc := tc
    		t.Run(fmt.Sprintf("Test_%d", i+1), func(t *testing.T) {
    			cfg, err := ParseConfig(bytes.NewReader([]byte(tc.inputConfig)))
    			if err != nil {
    				t.Fatalf("Got unexpected error: %v", err)
    			}
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Sun Jan 02 17:15:06 UTC 2022
    - 4.6K bytes
    - Viewed (0)
  4. docs/en/docs/tutorial/testing.md

    ///
    
    /// tip
    
    If you want to call `async` functions in your tests apart from sending requests to your FastAPI application (e.g. asynchronous database functions), have a look at the [Async Tests](../advanced/async-tests.md){.internal-link target=_blank} in the advanced tutorial.
    
    ///
    
    ## Separating tests
    
    In a real application, you probably would have your tests in a different file.
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 6.5K bytes
    - Viewed (0)
  5. docs/ja/docs/tutorial/testing.md

    ///
    
    /// tip | "豆知識"
    
    FastAPIアプリケーションへのリクエストの送信とは別に、テストで `async` 関数 (非同期データベース関数など) を呼び出したい場合は、高度なチュートリアルの[Async Tests](../advanced/async-tests.md){.internal-link target=_blank} を参照してください。
    
    ///
    
    ## テストの分離
    
    実際のアプリケーションでは、おそらくテストを別のファイルに保存します。
    
    また、**FastAPI** アプリケーションは、複数のファイル/モジュールなどで構成されている場合もあります。
    
    ### **FastAPI** アプリファイル
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 5.8K bytes
    - Viewed (0)
  6. docs/em/docs/tutorial/testing.md

    🤶 Ⓜ. `pip install httpx`.
    
    ///
    
    🗄 `TestClient`.
    
    ✍ `TestClient` 🚶‍♀️ 👆 **FastAPI** 🈸 ⚫️.
    
    ✍ 🔢 ⏮️ 📛 👈 ▶️ ⏮️ `test_` (👉 🐩 `pytest` 🏛).
    
    ⚙️ `TestClient` 🎚 🎏 🌌 👆 ⏮️ `httpx`.
    
    ✍ 🙅 `assert` 📄 ⏮️ 🐩 🐍 🧬 👈 👆 💪 ✅ (🔄, 🐩 `pytest`).
    
    ```Python hl_lines="2  12  15-18"
    {!../../docs_src/app_testing/tutorial001.py!}
    ```
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 5.1K bytes
    - Viewed (0)
  7. docs/de/docs/tutorial/testing.md

    ///
    
    /// tip | "Tipp"
    
    Wenn Sie in Ihren Tests neben dem Senden von Anfragen an Ihre FastAPI-Anwendung auch `async`-Funktionen aufrufen möchten (z. B. asynchrone Datenbankfunktionen), werfen Sie einen Blick auf die [Async-Tests](../advanced/async-tests.md){.internal-link target=_blank} im Handbuch für fortgeschrittene Benutzer.
    
    ///
    
    ## Tests separieren
    
    In einer echten Anwendung würden Sie Ihre Tests wahrscheinlich in einer anderen Datei haben.
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 6.9K bytes
    - Viewed (0)
  8. docs/ru/docs/tutorial/testing.md

    Например, так: `pip install httpx`.
    
    ///
    
    Импортируйте `TestClient`.
    
    Создайте объект `TestClient`, передав ему в качестве параметра Ваше приложение **FastAPI**.
    
    Создайте функцию, название которой должно начинаться с `test_` (это стандарт из соглашений `pytest`).
    
    Используйте объект `TestClient` так же, как Вы используете `httpx`.
    
    Напишите простое утверждение с `assert` дабы проверить истинность Python-выражения (это тоже стандарт `pytest`).
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 10.2K bytes
    - Viewed (0)
  9. internal/bucket/replication/replication_test.go

    			prefix:         "testdir/",
    			expectedNonRec: true,
    			expectedRec:    true,
    		},
    	}
    
    	for i, tc := range testCases {
    		tc := tc
    		t.Run(fmt.Sprintf("Test_%d", i+1), func(t *testing.T) {
    			cfg, err := ParseConfig(bytes.NewReader([]byte(tc.inputConfig)))
    			if err != nil {
    				t.Fatalf("Got unexpected error: %v", err)
    			}
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Thu Mar 28 17:44:56 UTC 2024
    - 32.5K bytes
    - Viewed (0)
  10. internal/bucket/lifecycle/lifecycle_test.go

    		tc := tc
    		t.Run(fmt.Sprintf("Test_%d", i+1), func(t *testing.T) {
    			lc, err := ParseLifecycleConfig(bytes.NewReader([]byte(tc.inputConfig)))
    			if err != nil {
    				t.Fatalf("Got unexpected error: %v", err)
    			}
    			// To ensure input lifecycle configurations are valid
    			if err := lc.Validate(lock.Retention{}); err != nil {
    				t.Fatalf("Invalid test case: %d %v", i+1, err)
    			}
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Thu May 23 01:12:48 UTC 2024
    - 55.1K bytes
    - Viewed (0)
Back to top