Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 6 of 6 for 03 (0.13 sec)

  1. tests/test_tutorial/test_request_files/test_tutorial001_03_an.py

    from fastapi.testclient import TestClient
    
    from docs_src.request_files.tutorial001_03_an import app
    
    client = TestClient(app)
    
    
    def test_post_file(tmp_path):
        path = tmp_path / "test.txt"
        path.write_bytes(b"<file content>")
    
        client = TestClient(app)
        with path.open("rb") as file:
            response = client.post("/files/", files={"file": file})
        assert response.status_code == 200, response.text
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jun 30 18:25:16 GMT 2023
    - 6K bytes
    - Viewed (0)
  2. docs_src/request_files/tutorial001_03_an_py39.py

    Sebastián Ramírez <******@****.***> 1679142599 +0100
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Mar 18 12:29:59 GMT 2023
    - 421 bytes
    - Viewed (0)
  3. docs_src/request_files/tutorial001_03_an.py

    Sebastián Ramírez <******@****.***> 1679142599 +0100
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Mar 18 12:29:59 GMT 2023
    - 431 bytes
    - Viewed (0)
  4. tests/test_tutorial/test_request_files/test_tutorial001_03_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.request_files.tutorial001_03_an_py39 import app
    
        client = TestClient(app)
        return client
    
    
    @needs_py39
    def test_post_file(tmp_path, client: TestClient):
        path = tmp_path / "test.txt"
        path.write_bytes(b"<file content>")
    
        with path.open("rb") as file:
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jun 30 18:25:16 GMT 2023
    - 6.2K bytes
    - Viewed (0)
  5. tests/test_tutorial/test_response_model/test_tutorial003_03.py

    from fastapi.testclient import TestClient
    
    from docs_src.response_model.tutorial003_03 import app
    
    client = TestClient(app)
    
    
    def test_get_portal():
        response = client.get("/teleport", follow_redirects=False)
        assert response.status_code == 307, response.text
        assert response.headers["location"] == "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
    
    
    def test_openapi_schema():
        response = client.get("/openapi.json")
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jun 30 18:25:16 GMT 2023
    - 1.1K bytes
    - Viewed (0)
  6. tests/test_tutorial/test_request_files/test_tutorial001_03.py

    from fastapi.testclient import TestClient
    
    from docs_src.request_files.tutorial001_03 import app
    
    client = TestClient(app)
    
    
    def test_post_file(tmp_path):
        path = tmp_path / "test.txt"
        path.write_bytes(b"<file content>")
    
        client = TestClient(app)
        with path.open("rb") as file:
            response = client.post("/files/", files={"file": file})
        assert response.status_code == 200, response.text
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jun 30 18:25:16 GMT 2023
    - 6K bytes
    - Viewed (0)
Back to top