Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 24 for read_main (0.35 sec)

  1. tests/test_tutorial/test_testing/test_tutorial001.py

    from docs_src.app_testing.tutorial001 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": {
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jun 30 18:25:16 GMT 2023
    - 821 bytes
    - Viewed (0)
  2. tests/test_tutorial/test_testing/test_main.py

    from docs_src.app_testing.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": {
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jun 30 18:25:16 GMT 2023
    - 819 bytes
    - Viewed (0)
  3. docs_src/app_testing/tutorial001.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
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Mar 26 19:09:53 GMT 2020
    - 334 bytes
    - Viewed (0)
  4. tests/test_tutorial/test_testing/test_tutorial002.py

    from docs_src.app_testing.tutorial002 import test_read_main, test_websocket
    
    
    def test_main():
        test_read_main()
    
    
    def test_ws():
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jul 10 09:08:19 GMT 2020
    - 154 bytes
    - Viewed (0)
  5. docs_src/app_testing/tutorial002.py

    from fastapi.websockets import WebSocket
    
    app = FastAPI()
    
    
    @app.get("/")
    async def read_main():
        return {"msg": "Hello World"}
    
    
    @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("/")
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Wed Feb 08 10:23:07 GMT 2023
    - 757 bytes
    - Viewed (0)
  6. tests/test_deprecated_openapi_prefix.py

    from fastapi import FastAPI, Request
    from fastapi.testclient import TestClient
    
    app = FastAPI(openapi_prefix="/api/v1")
    
    
    @app.get("/app")
    def read_main(request: Request):
        return {"message": "Hello World", "root_path": request.scope.get("root_path")}
    
    
    client = TestClient(app)
    
    
    def test_main():
        response = client.get("/app")
        assert response.status_code == 200
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jun 30 18:25:16 GMT 2023
    - 1.2K bytes
    - Viewed (0)
  7. docs_src/app_testing/main.py

    from fastapi import FastAPI
    
    app = FastAPI()
    
    
    @app.get("/")
    async def read_main():
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Mar 26 19:09:53 GMT 2020
    - 118 bytes
    - Viewed (0)
  8. docs_src/app_testing/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
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Mar 26 19:09:53 GMT 2020
    - 238 bytes
    - Viewed (0)
  9. docs_src/behind_a_proxy/tutorial002.py

    from fastapi import FastAPI, Request
    
    app = FastAPI(root_path="/api/v1")
    
    
    @app.get("/app")
    def read_main(request: Request):
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Jun 11 21:53:19 GMT 2020
    - 208 bytes
    - Viewed (0)
  10. docs_src/behind_a_proxy/tutorial001.py

    from fastapi import FastAPI, Request
    
    app = FastAPI()
    
    
    @app.get("/app")
    def read_main(request: Request):
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Jun 11 21:53:19 GMT 2020
    - 189 bytes
    - Viewed (0)
Back to top