Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 7 of 7 for test_root (0.18 sec)

  1. docs_src/async_tests/test_main.py

    import pytest
    from httpx import AsyncClient
    
    from .main import app
    
    
    @pytest.mark.anyio
    async def test_root():
        async with AsyncClient(app=app, base_url="http://test") as ac:
            response = await ac.get("/")
        assert response.status_code == 200
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Wed Oct 06 15:32:11 GMT 2021
    - 306 bytes
    - Viewed (0)
  2. tests/test_tutorial/test_bigger_applications/test_main_an.py

                    }
                ]
            }
        )
    
    
    def test_root_token_jessica(client: TestClient):
        response = client.get("/?token=jessica")
        assert response.status_code == 200
        assert response.json() == {"message": "Hello Bigger Applications!"}
    
    
    def test_root_with_no_token(client: TestClient):
        response = client.get("/")
        assert response.status_code == 422
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 24.6K bytes
    - Viewed (0)
  3. tests/test_tutorial/test_bigger_applications/test_main_an_py39.py

                    }
                ]
            }
        )
    
    
    @needs_py39
    def test_root_token_jessica(client: TestClient):
        response = client.get("/?token=jessica")
        assert response.status_code == 200
        assert response.json() == {"message": "Hello Bigger Applications!"}
    
    
    @needs_py39
    def test_root_with_no_token(client: TestClient):
        response = client.get("/")
        assert response.status_code == 422
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 24.9K bytes
    - Viewed (0)
  4. tests/test_tutorial/test_async_tests/test_main.py

    import pytest
    
    from docs_src.async_tests.test_main import test_root
    
    
    @pytest.mark.anyio
    async def test_async_testing():
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Wed Oct 06 15:32:11 GMT 2021
    - 143 bytes
    - Viewed (0)
  5. tests/test_tutorial/test_path_params/test_tutorial004.py

        response = client.get("/files/home/johndoe/myfile.txt")
        print(response.content)
        assert response.status_code == 200, response.text
        assert response.json() == {"file_path": "home/johndoe/myfile.txt"}
    
    
    def test_root_file_path():
        response = client.get("/files//home/johndoe/myfile.txt")
        print(response.content)
        assert response.status_code == 200, response.text
        assert response.json() == {"file_path": "/home/johndoe/myfile.txt"}
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jun 30 18:25:16 GMT 2023
    - 3.3K bytes
    - Viewed (0)
  6. tests/test_tutorial/test_conditional_openapi/test_tutorial001.py

        response = client.get("/docs")
        assert response.status_code == 404, response.text
        response = client.get("/redoc")
        assert response.status_code == 404, response.text
    
    
    @needs_pydanticv2
    def test_root():
        client = get_client()
        response = client.get("/")
        assert response.status_code == 200
        assert response.json() == {"message": "Hello World"}
    
    
    @needs_pydanticv2
    def test_default_openapi():
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jul 07 17:12:13 GMT 2023
    - 1.8K bytes
    - Viewed (0)
  7. tests/test_tutorial/test_bigger_applications/test_main.py

                    }
                ]
            }
        )
    
    
    def test_root_token_jessica(client: TestClient):
        response = client.get("/?token=jessica")
        assert response.status_code == 200
        assert response.json() == {"message": "Hello Bigger Applications!"}
    
    
    def test_root_with_no_token(client: TestClient):
        response = client.get("/")
        assert response.status_code == 422
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 24.6K bytes
    - Viewed (0)
Back to top