- Sort Score
- Result 10 results
- Languages All
Results 51 - 60 of 62 for testDomain (0.12 sec)
-
tests/test_tutorial/test_websockets/test_tutorial002_an_py310.py
from ...utils import needs_py310 @pytest.fixture(name="app") def get_app(): from docs_src.websockets.tutorial002_an_py310 import app return app @needs_py310 def test_main(app: FastAPI): client = TestClient(app) response = client.get("/") assert response.status_code == 200, response.text assert b"<!DOCTYPE html>" in response.content @needs_py310
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sat Mar 18 12:29:59 UTC 2023 - 3.9K bytes - Viewed (0) -
tests/test_tutorial/test_websockets/test_tutorial002_an.py
import pytest from fastapi.testclient import TestClient from fastapi.websockets import WebSocketDisconnect from docs_src.websockets.tutorial002_an import app def test_main(): client = TestClient(app) response = client.get("/") assert response.status_code == 200, response.text assert b"<!DOCTYPE html>" in response.content def test_websocket_with_cookie(): client = TestClient(app, cookies={"session": "fakesession"})
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sat Mar 18 12:29:59 UTC 2023 - 3.6K bytes - Viewed (0) -
tests/test_tutorial/test_websockets/test_tutorial002.py
import pytest from fastapi.testclient import TestClient from fastapi.websockets import WebSocketDisconnect from docs_src.websockets.tutorial002 import app def test_main(): client = TestClient(app) response = client.get("/") assert response.status_code == 200, response.text assert b"<!DOCTYPE html>" in response.content def test_websocket_with_cookie(): client = TestClient(app, cookies={"session": "fakesession"})
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sun Nov 13 14:26:09 UTC 2022 - 3.6K bytes - Viewed (0) -
tests/test_tutorial/test_websockets/test_tutorial002_py310.py
from ...utils import needs_py310 @pytest.fixture(name="app") def get_app(): from docs_src.websockets.tutorial002_py310 import app return app @needs_py310 def test_main(app: FastAPI): client = TestClient(app) response = client.get("/") assert response.status_code == 200, response.text assert b"<!DOCTYPE html>" in response.content @needs_py310
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sat Mar 18 12:29:59 UTC 2023 - 3.9K bytes - Viewed (0) -
src/cmd/api/api_test.go
import ( "flag" "fmt" "go/build" "internal/testenv" "os" "path/filepath" "sort" "strings" "sync" "testing" ) var flagCheck = flag.Bool("check", false, "run API checks") func TestMain(m *testing.M) { flag.Parse() for _, c := range contexts { c.Compiler = build.Default.Compiler } build.Default.GOROOT = testenv.GOROOT(nil) os.Exit(m.Run()) } var (
Registered: Tue Nov 05 11:13:11 UTC 2024 - Last Modified: Thu Jan 04 17:31:12 UTC 2024 - 7.1K bytes - Viewed (0) -
docs/de/docs/advanced/settings.md
Dann wäre es sehr einfach, beim Testen ein anderes Einstellungsobjekt bereitzustellen, indem man eine Abhängigkeitsüberschreibung für `get_settings` erstellt: ```Python hl_lines="9-10 13 21" {!../../docs_src/settings/app02/test_main.py!} ``` Bei der Abhängigkeitsüberschreibung legen wir einen neuen Wert für `admin_email` fest, wenn wir das neue `Settings`-Objekt erstellen, und geben dann dieses neue Objekt zurück.
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sun Oct 06 20:36:54 UTC 2024 - 17.7K bytes - Viewed (0) -
docs/em/docs/advanced/settings.md
{!../../docs_src/settings/app02/main.py!} ``` ### ⚒ & 🔬 ⤴️ ⚫️ 🔜 📶 ⏩ 🚚 🎏 ⚒ 🎚 ⏮️ 🔬 🏗 🔗 🔐 `get_settings`: ```Python hl_lines="9-10 13 21" {!../../docs_src/settings/app02/test_main.py!} ``` 🔗 🔐 👥 ⚒ 🆕 💲 `admin_email` 🕐❔ 🏗 🆕 `Settings` 🎚, & ⤴️ 👥 📨 👈 🆕 🎚. ⤴️ 👥 💪 💯 👈 ⚫️ ⚙️. ## 👂 `.env` 📁
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sun Oct 06 20:36:54 UTC 2024 - 11.3K bytes - Viewed (0) -
docs/en/docs/advanced/settings.md
Then it would be very easy to provide a different settings object during testing by creating a dependency override for `get_settings`: ```Python hl_lines="9-10 13 21" {!../../docs_src/settings/app02/test_main.py!} ``` In the dependency override we set a new value for the `admin_email` when creating the new `Settings` object, and then we return that new object. Then we can test that it is used.
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sun Oct 06 20:36:54 UTC 2024 - 12.9K bytes - Viewed (0) -
docs/zh/docs/advanced/settings.md
{!> ../../docs_src/settings/app02/main.py!} ``` //// ### 设置和测试 然后,在测试期间,通过创建 `get_settings` 的依赖项覆盖,很容易提供一个不同的设置对象: ```Python hl_lines="9-10 13 21" {!../../docs_src/settings/app02/test_main.py!} ``` 在依赖项覆盖中,我们在创建新的 `Settings` 对象时为 `admin_email` 设置了一个新值,然后返回该新对象。 然后,我们可以测试它是否被使用。 ## 从 `.env` 文件中读取设置 如果您有许多可能经常更改的设置,可能在不同的环境中,将它们放在一个文件中,然后从该文件中读取它们,就像它们是环境变量一样,可能非常有用。
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sun Oct 06 20:36:54 UTC 2024 - 13.8K bytes - Viewed (0) -
docs/pt/docs/advanced/settings.md
Então seria muito fácil fornecer uma configuração diferente durante a execução dos testes sobrescrevendo a dependência de `get_settings`: ```Python hl_lines="9-10 13 21" {!../../docs_src/settings/app02/test_main.py!} ``` Na sobrescrita da dependência, definimos um novo valor para `admin_email` quando instanciamos um novo objeto `Settings`, e então retornamos esse novo objeto.
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sun Oct 06 20:36:54 UTC 2024 - 17K bytes - Viewed (0)