- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 448 for TestClient (0.1 sec)
-
fastapi/testclient.py
from starlette.testclient import TestClient as TestClient # noqa...
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sun Dec 20 18:50:00 UTC 2020 - 66 bytes - Viewed (0) -
docs/en/docs/reference/testclient.md
You can use the `TestClient` class to test FastAPI applications without creating an actual HTTP and socket connection, just communicating directly with the FastAPI code. Read more about it in the [FastAPI docs for Testing](https://fastapi.tiangolo.com/tutorial/testing/). You can import it directly from `fastapi.testclient`: ```python from fastapi.testclient import TestClient ```
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Thu Apr 18 19:53:19 UTC 2024 - 450 bytes - Viewed (0) -
tests/test_tutorial/test_dependencies/test_tutorial008d_an_py39.py
import pytest from fastapi.testclient import TestClient from ...utils import needs_py39 @pytest.fixture(name="client") def get_client(): from docs_src.dependencies.tutorial008d_an_py39 import app client = TestClient(app) return client @needs_py39 def test_get_no_item(client: TestClient): response = client.get("/items/foo") assert response.status_code == 404, response.text
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sat Feb 24 23:06:37 UTC 2024 - 1.3K bytes - Viewed (0) -
tests/test_tutorial/test_request_form_models/test_tutorial002_an_py39.py
import pytest from fastapi.testclient import TestClient from tests.utils import needs_py39, needs_pydanticv2 @pytest.fixture(name="client") def get_client(): from docs_src.request_form_models.tutorial002_an_py39 import app client = TestClient(app) return client @needs_pydanticv2 @needs_py39 def test_post_body_form(client: TestClient):
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Fri Sep 06 17:31:18 UTC 2024 - 6.3K bytes - Viewed (0) -
tests/test_tutorial/test_dependencies/test_tutorial008b_an_py39.py
import pytest from fastapi.testclient import TestClient from ...utils import needs_py39 @pytest.fixture(name="client") def get_client(): from docs_src.dependencies.tutorial008b_an_py39 import app client = TestClient(app) return client @needs_py39 def test_get_no_item(client: TestClient): response = client.get("/items/foo") assert response.status_code == 404, response.text
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sat Feb 24 23:06:37 UTC 2024 - 918 bytes - Viewed (0) -
tests/test_tutorial/test_path_operation_advanced_configurations/test_tutorial007.py
import pytest from fastapi.testclient import TestClient from ...utils import needs_pydanticv2 @pytest.fixture(name="client") def get_client(): from docs_src.path_operation_advanced_configuration.tutorial007 import app client = TestClient(app) return client @needs_pydanticv2 def test_post(client: TestClient): yaml_data = """ name: Deadpoolio tags: - x-force - x-men
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Thu Apr 18 19:40:57 UTC 2024 - 3.3K bytes - Viewed (0) -
tests/test_tutorial/test_request_form_models/test_tutorial001.py
import pytest from dirty_equals import IsDict from fastapi.testclient import TestClient @pytest.fixture(name="client") def get_client(): from docs_src.request_form_models.tutorial001 import app client = TestClient(app) return client def test_post_body_form(client: TestClient): response = client.post("/login/", data={"username": "Foo", "password": "secret"}) assert response.status_code == 200
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Thu Sep 05 15:16:50 UTC 2024 - 7.4K bytes - Viewed (0) -
tests/test_tutorial/test_request_forms/test_tutorial001.py
import pytest from dirty_equals import IsDict from fastapi.testclient import TestClient @pytest.fixture(name="client") def get_client(): from docs_src.request_forms.tutorial001 import app client = TestClient(app) return client def test_post_body_form(client: TestClient): response = client.post("/login/", data={"username": "Foo", "password": "secret"}) assert response.status_code == 200
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Thu Apr 18 19:40:57 UTC 2024 - 7.5K bytes - Viewed (0) -
tests/test_tutorial/test_request_forms/test_tutorial001_an.py
import pytest from dirty_equals import IsDict from fastapi.testclient import TestClient @pytest.fixture(name="client") def get_client(): from docs_src.request_forms.tutorial001_an import app client = TestClient(app) return client def test_post_body_form(client: TestClient): response = client.post("/login/", data={"username": "Foo", "password": "secret"}) assert response.status_code == 200
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Thu Apr 18 19:40:57 UTC 2024 - 7.5K bytes - Viewed (0) -
tests/test_tutorial/test_request_forms/test_tutorial001_an_py39.py
import pytest from dirty_equals import IsDict from fastapi.testclient import TestClient from ...utils import needs_py39 @pytest.fixture(name="client") def get_client(): from docs_src.request_forms.tutorial001_an_py39 import app client = TestClient(app) return client @needs_py39 def test_post_body_form(client: TestClient): response = client.post("/login/", data={"username": "Foo", "password": "secret"})
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Thu Apr 18 19:40:57 UTC 2024 - 7.6K bytes - Viewed (0)