Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 9 of 9 for test_swagger_ui (0.27 sec)

  1. tests/test_swagger_ui_init_oauth.py

    app = FastAPI(swagger_ui_init_oauth=swagger_ui_init_oauth)
    
    
    @app.get("/items/")
    async def read_items():
        return {"id": "foo"}
    
    
    client = TestClient(app)
    
    
    def test_swagger_ui():
        response = client.get("/docs")
        assert response.status_code == 200, response.text
        print(response.text)
        assert "ui.initOAuth" in response.text
        assert '"appName": "The Predendapp"' in response.text
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sun Aug 09 10:54:05 GMT 2020
    - 718 bytes
    - Viewed (0)
  2. tests/test_no_swagger_ui_redirect.py

    
    client = TestClient(app)
    
    
    def test_swagger_ui():
        response = client.get("/docs")
        assert response.status_code == 200, response.text
        assert response.headers["content-type"] == "text/html; charset=utf-8"
        assert "swagger-ui-dist" in response.text
        print(client.base_url)
        assert "oauth2RedirectUrl" not in response.text
    
    
    def test_swagger_ui_no_oauth2_redirect():
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Wed Apr 08 04:37:38 GMT 2020
    - 786 bytes
    - Viewed (0)
  3. tests/test_custom_swagger_ui_redirect.py

    app = FastAPI(swagger_ui_oauth2_redirect_url=swagger_ui_oauth2_redirect_url)
    
    
    @app.get("/items/")
    async def read_items():
        return {"id": "foo"}
    
    
    client = TestClient(app)
    
    
    def test_swagger_ui():
        response = client.get("/docs")
        assert response.status_code == 200, response.text
        assert response.headers["content-type"] == "text/html; charset=utf-8"
        assert "swagger-ui-dist" in response.text
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Wed Apr 08 04:37:38 GMT 2020
    - 1.1K bytes
    - Viewed (0)
  4. tests/test_tutorial/test_custom_docs_ui/test_tutorial002.py

            yield client
        static_dir.rmdir()
    
    
    def test_swagger_ui_html(client: TestClient):
        response = client.get("/docs")
        assert response.status_code == 200, response.text
        assert "/static/swagger-ui-bundle.js" in response.text
        assert "/static/swagger-ui.css" in response.text
    
    
    def test_swagger_ui_oauth2_redirect_html(client: TestClient):
        response = client.get("/docs/oauth2-redirect")
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Aug 19 19:54:04 GMT 2023
    - 1.2K bytes
    - Viewed (0)
  5. tests/test_tutorial/test_custom_docs_ui/test_tutorial001.py

        static_dir.rmdir()
    
    
    def test_swagger_ui_html(client: TestClient):
        response = client.get("/docs")
        assert response.status_code == 200, response.text
        assert (
            "https://unpkg.com/swagger-ui-dist@5.9.0/swagger-ui-bundle.js" in response.text
        )
        assert "https://unpkg.com/swagger-ui-dist@5.9.0/swagger-ui.css" in response.text
    
    
    def test_swagger_ui_oauth2_redirect_html(client: TestClient):
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Mon Oct 30 09:58:58 GMT 2023
    - 1.3K bytes
    - Viewed (0)
  6. tests/test_tutorial/test_configure_swagger_ui/test_tutorial001.py

    from fastapi.testclient import TestClient
    
    from docs_src.configure_swagger_ui.tutorial001 import app
    
    client = TestClient(app)
    
    
    def test_swagger_ui():
        response = client.get("/docs")
        assert response.status_code == 200, response.text
        assert (
            '"syntaxHighlight": false' in response.text
        ), "syntaxHighlight should be included and converted to JSON"
        assert (
            '"dom_id": "#swagger-ui"' in response.text
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Aug 19 19:54:04 GMT 2023
    - 1.4K bytes
    - Viewed (0)
  7. tests/test_tutorial/test_configure_swagger_ui/test_tutorial002.py

    from fastapi.testclient import TestClient
    
    from docs_src.configure_swagger_ui.tutorial002 import app
    
    client = TestClient(app)
    
    
    def test_swagger_ui():
        response = client.get("/docs")
        assert response.status_code == 200, response.text
        assert (
            '"syntaxHighlight": false' not in response.text
        ), "not used parameters should not be included"
        assert (
            '"syntaxHighlight.theme": "obsidian"' in response.text
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Aug 19 19:54:04 GMT 2023
    - 1.5K bytes
    - Viewed (0)
  8. tests/test_tutorial/test_configure_swagger_ui/test_tutorial003.py

    from fastapi.testclient import TestClient
    
    from docs_src.configure_swagger_ui.tutorial003 import app
    
    client = TestClient(app)
    
    
    def test_swagger_ui():
        response = client.get("/docs")
        assert response.status_code == 200, response.text
        assert (
            '"deepLinking": false,' in response.text
        ), "overridden configs should be preserved"
        assert (
            '"deepLinking": true' not in response.text
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Aug 19 19:54:04 GMT 2023
    - 1.5K bytes
    - Viewed (0)
  9. tests/test_application.py

        ],
    )
    def test_get_path(path, expected_status, expected_response):
        response = client.get(path)
        assert response.status_code == expected_status
        assert response.json() == expected_response
    
    
    def test_swagger_ui():
        response = client.get("/docs")
        assert response.status_code == 200, response.text
        assert response.headers["content-type"] == "text/html; charset=utf-8"
        assert "swagger-ui-dist" in response.text
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 21:56:59 GMT 2024
    - 52.2K bytes
    - Viewed (0)
Back to top