Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 185 for test_Get (0.19 sec)

  1. tests/test_tutorial/test_custom_response/test_tutorial009.py

    from pathlib import Path
    
    from fastapi.testclient import TestClient
    
    from docs_src.custom_response import tutorial009
    from docs_src.custom_response.tutorial009 import app
    
    client = TestClient(app)
    
    
    def test_get(tmp_path: Path):
        file_path: Path = tmp_path / "large-video-file.mp4"
        tutorial009.some_file_path = str(file_path)
        test_content = b"Fake video bytes"
        file_path.write_bytes(test_content)
        response = client.get("/")
    Registered: Mon Jun 17 08:32:26 UTC 2024
    - Last Modified: Sat Jul 03 19:51:28 UTC 2021
    - 487 bytes
    - Viewed (0)
  2. tests/test_tutorial/test_custom_response/test_tutorial009c.py

    from fastapi.testclient import TestClient
    
    from docs_src.custom_response.tutorial009c import app
    
    client = TestClient(app)
    
    
    def test_get():
        response = client.get("/")
    Registered: Mon Jun 17 08:32:26 UTC 2024
    - Last Modified: Thu Sep 01 09:32:30 UTC 2022
    - 239 bytes
    - Viewed (0)
  3. tests/test_tutorial/test_custom_response/test_tutorial007.py

    from fastapi.testclient import TestClient
    
    from docs_src.custom_response.tutorial007 import app
    
    client = TestClient(app)
    
    
    def test_get():
        fake_content = b"some fake video bytes"
        response = client.get("/")
    Registered: Mon Jun 17 08:32:26 UTC 2024
    - Last Modified: Thu Jul 09 18:06:12 UTC 2020
    - 264 bytes
    - Viewed (0)
  4. tests/test_tutorial/test_path_operation_advanced_configurations/test_tutorial001.py

    from fastapi.testclient import TestClient
    
    from docs_src.path_operation_advanced_configuration.tutorial001 import app
    
    client = TestClient(app)
    
    
    def test_get():
        response = client.get("/items/")
        assert response.status_code == 200, response.text
        assert response.json() == [{"item_id": "Foo"}]
    
    
    def test_openapi_schema():
        response = client.get("/openapi.json")
        assert response.status_code == 200, response.text
    Registered: Mon Jun 17 08:32:26 UTC 2024
    - Last Modified: Fri Jun 30 18:25:16 UTC 2023
    - 1K bytes
    - Viewed (0)
  5. tests/test_tutorial/test_path_operation_advanced_configurations/test_tutorial002.py

    from fastapi.testclient import TestClient
    
    from docs_src.path_operation_advanced_configuration.tutorial002 import app
    
    client = TestClient(app)
    
    
    def test_get():
        response = client.get("/items/")
        assert response.status_code == 200, response.text
        assert response.json() == [{"item_id": "Foo"}]
    
    
    def test_openapi_schema():
        response = client.get("/openapi.json")
        assert response.status_code == 200, response.text
    Registered: Mon Jun 17 08:32:26 UTC 2024
    - Last Modified: Fri Jun 30 18:25:16 UTC 2023
    - 1020 bytes
    - Viewed (0)
  6. tests/test_tutorial/test_custom_response/test_tutorial008.py

    from pathlib import Path
    
    from fastapi.testclient import TestClient
    
    from docs_src.custom_response import tutorial008
    from docs_src.custom_response.tutorial008 import app
    
    client = TestClient(app)
    
    
    def test_get(tmp_path: Path):
        file_path: Path = tmp_path / "large-video-file.mp4"
        tutorial008.some_file_path = str(file_path)
        test_content = b"Fake video bytes"
        file_path.write_bytes(test_content)
        response = client.get("/")
    Registered: Mon Jun 17 08:32:26 UTC 2024
    - Last Modified: Thu Jul 09 18:06:12 UTC 2020
    - 487 bytes
    - Viewed (0)
  7. tests/test_router_prefix_with_template.py

    
    @router.get("/users/{id}")
    def read_user(segment: str, id: str):
        return {"segment": segment, "id": id}
    
    
    app.include_router(router, prefix="/{segment}")
    
    
    client = TestClient(app)
    
    
    def test_get():
        response = client.get("/seg/users/foo")
        assert response.status_code == 200, response.text
    Registered: Mon Jun 17 08:32:26 UTC 2024
    - Last Modified: Wed Apr 08 04:37:38 UTC 2020
    - 484 bytes
    - Viewed (0)
  8. tests/test_tutorial/test_custom_request_and_route/test_tutorial003.py

    from fastapi.testclient import TestClient
    
    from docs_src.custom_request_and_route.tutorial003 import app
    
    client = TestClient(app)
    
    
    def test_get():
        response = client.get("/")
        assert response.json() == {"message": "Not timed"}
        assert "X-Response-Time" not in response.headers
    
    
    def test_get_timed():
        response = client.get("/timed")
        assert response.json() == {"message": "It's the time of my life"}
    Registered: Mon Jun 17 08:32:26 UTC 2024
    - Last Modified: Thu Jul 09 18:06:12 UTC 2020
    - 526 bytes
    - Viewed (0)
  9. tests/test_tutorial/test_path_operation_advanced_configurations/test_tutorial005.py

    from fastapi.testclient import TestClient
    
    from docs_src.path_operation_advanced_configuration.tutorial005 import app
    
    client = TestClient(app)
    
    
    def test_get():
        response = client.get("/items/")
        assert response.status_code == 200, response.text
    
    
    def test_openapi_schema():
        response = client.get("/openapi.json")
        assert response.status_code == 200, response.text
        assert response.json() == {
            "openapi": "3.1.0",
    Registered: Mon Jun 17 08:32:26 UTC 2024
    - Last Modified: Fri Jun 30 18:25:16 UTC 2023
    - 1K bytes
    - Viewed (0)
  10. tests/test_tutorial/test_custom_response/test_tutorial009b.py

    from pathlib import Path
    
    from fastapi.testclient import TestClient
    
    from docs_src.custom_response import tutorial009b
    from docs_src.custom_response.tutorial009b import app
    
    client = TestClient(app)
    
    
    def test_get(tmp_path: Path):
        file_path: Path = tmp_path / "large-video-file.mp4"
        tutorial009b.some_file_path = str(file_path)
        test_content = b"Fake video bytes"
        file_path.write_bytes(test_content)
    Registered: Mon Jun 17 08:32:26 UTC 2024
    - Last Modified: Sat Jul 03 19:51:28 UTC 2021
    - 490 bytes
    - Viewed (0)
Back to top