Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 6 of 6 for test_read_main (0.07 sec)

  1. tests/test_tutorial/test_testing/test_main_a.py

    from docs_src.app_testing.app_a_py39.test_main import client, test_read_main
    
    
    def test_main():
        test_read_main()
    
    
    def test_openapi_schema():
        response = client.get("/openapi.json")
        assert response.status_code == 200, response.text
        assert response.json() == {
            "openapi": "3.1.0",
            "info": {"title": "FastAPI", "version": "0.1.0"},
            "paths": {
                "/": {
                    "get": {
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 830 bytes
    - Viewed (0)
  2. tests/test_tutorial/test_testing/test_tutorial001.py

    from docs_src.app_testing.tutorial001_py39 import client, test_read_main
    
    
    def test_main():
        test_read_main()
    
    
    def test_openapi_schema():
        response = client.get("/openapi.json")
        assert response.status_code == 200, response.text
        assert response.json() == {
            "openapi": "3.1.0",
            "info": {"title": "FastAPI", "version": "0.1.0"},
            "paths": {
                "/": {
                    "get": {
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 826 bytes
    - Viewed (0)
  3. tests/test_tutorial/test_testing/test_tutorial002.py

    from docs_src.app_testing.tutorial002_py39 import test_read_main, test_websocket
    
    
    def test_main():
        test_read_main()
    
    
    def test_ws():
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 159 bytes
    - Viewed (0)
  4. docs_src/app_testing/app_a_py39/test_main.py

    from fastapi.testclient import TestClient
    
    from .main import app
    
    client = TestClient(app)
    
    
    def test_read_main():
        response = client.get("/")
        assert response.status_code == 200
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 238 bytes
    - Viewed (0)
  5. docs_src/app_testing/tutorial001_py39.py

    from fastapi import FastAPI
    from fastapi.testclient import TestClient
    
    app = FastAPI()
    
    
    @app.get("/")
    async def read_main():
        return {"msg": "Hello World"}
    
    
    client = TestClient(app)
    
    
    def test_read_main():
        response = client.get("/")
        assert response.status_code == 200
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 334 bytes
    - Viewed (0)
  6. docs_src/app_testing/tutorial002_py39.py

    
    @app.websocket("/ws")
    async def websocket(websocket: WebSocket):
        await websocket.accept()
        await websocket.send_json({"msg": "Hello WebSocket"})
        await websocket.close()
    
    
    def test_read_main():
        client = TestClient(app)
        response = client.get("/")
        assert response.status_code == 200
        assert response.json() == {"msg": "Hello World"}
    
    
    def test_websocket():
        client = TestClient(app)
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 757 bytes
    - Viewed (0)
Back to top