Search Options

Results per page
Sort
Preferred Languages
Advance

Results 141 - 150 of 1,036 for Assert1 (0.06 sec)

  1. tests/test_custom_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 (
            f"oauth2RedirectUrl: window.location.origin + '{swagger_ui_oauth2_redirect_url}'"
            in response.text
        )
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Wed Apr 08 04:37:38 UTC 2020
    - 1.1K bytes
    - Viewed (0)
  2. tests/test_tutorial/test_query_params_str_validations/test_tutorial014.py

    
    def test_hidden_query():
        response = client.get("/items?hidden_query=somevalue")
        assert response.status_code == 200, response.text
        assert response.json() == {"hidden_query": "somevalue"}
    
    
    def test_no_hidden_query():
        response = client.get("/items")
        assert response.status_code == 200, response.text
        assert response.json() == {"hidden_query": "Not found"}
    
    
    def test_openapi_schema():
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Fri Jun 30 18:25:16 UTC 2023
    - 2.9K bytes
    - Viewed (0)
  3. docs_src/dependency_testing/tutorial001_py310.py

    def test_override_in_items():
        response = client.get("/items/")
        assert response.status_code == 200
        assert response.json() == {
            "message": "Hello Items!",
            "params": {"q": None, "skip": 5, "limit": 10},
        }
    
    
    def test_override_in_items_with_q():
        response = client.get("/items/?q=foo")
        assert response.status_code == 200
        assert response.json() == {
            "message": "Hello Items!",
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sat Mar 18 12:29:59 UTC 2023
    - 1.4K bytes
    - Viewed (0)
  4. tests/test_tutorial/test_request_files/test_tutorial001.py

            response = client.post("/uploadfile/", files={"file": file})
        assert response.status_code == 200, response.text
        assert response.json() == {"filename": "test.txt"}
    
    
    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"},
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Thu Apr 18 19:40:57 UTC 2024
    - 7.7K bytes
    - Viewed (0)
  5. tests/test_tutorial/test_request_files/test_tutorial001_an.py

            response = client.post("/uploadfile/", files={"file": file})
        assert response.status_code == 200, response.text
        assert response.json() == {"filename": "test.txt"}
    
    
    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": {
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Thu Apr 18 19:40:57 UTC 2024
    - 7.5K bytes
    - Viewed (0)
  6. tests/test_param_include_in_schema.py

        client = TestClient(app)
        response = client.get(path, headers=headers)
        assert response.status_code == expected_status
        assert response.json() == expected_response
    
    
    def test_hidden_path():
        client = TestClient(app)
        response = client.get("/hidden_path/hidden_path")
        assert response.status_code == 200
        assert response.json() == {"hidden_path": "hidden_path"}
    
    
    @pytest.mark.parametrize(
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Tue Mar 26 16:56:53 UTC 2024
    - 7.4K bytes
    - Viewed (0)
  7. tests/test_ws_router.py

        with client.websocket_connect("/") as websocket:
            data = websocket.receive_text()
            assert data == "Hello, world!"
    
    
    def test_router():
        client = TestClient(app)
        with client.websocket_connect("/router") as websocket:
            data = websocket.receive_text()
            assert data == "Hello, router!"
    
    
    def test_prefix_router():
        client = TestClient(app)
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Jun 11 19:08:14 UTC 2023
    - 7.5K bytes
    - Viewed (0)
  8. tests/test_tutorial/test_request_files/test_tutorial001_an_py39.py

            response = client.post("/uploadfile/", files={"file": file})
        assert response.status_code == 200, response.text
        assert response.json() == {"filename": "test.txt"}
    
    
    @needs_py39
    def test_openapi_schema(client: TestClient):
        response = client.get("/openapi.json")
        assert response.status_code == 200, response.text
        assert response.json() == {
            "openapi": "3.1.0",
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Thu Apr 18 19:40:57 UTC 2024
    - 7.7K bytes
    - Viewed (0)
  9. tests/test_tutorial/test_request_form_models/test_tutorial001_an_py39.py

        assert response.status_code == 200
        assert response.json() == {"username": "Foo", "password": "secret"}
    
    
    @needs_py39
    def test_post_body_form_no_password(client: TestClient):
        response = client.post("/login/", data={"username": "Foo"})
        assert response.status_code == 422
        assert response.json() == IsDict(
            {
                "detail": [
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Thu Sep 05 15:16:50 UTC 2024
    - 7.5K bytes
    - Viewed (0)
  10. tests/test_security_http_bearer_optional.py

        response = client.get("/users/me", headers={"Authorization": "Bearer foobar"})
        assert response.status_code == 200, response.text
        assert response.json() == {"scheme": "Bearer", "credentials": "foobar"}
    
    
    def test_security_http_bearer_no_credentials():
        response = client.get("/users/me")
        assert response.status_code == 200, response.text
        assert response.json() == {"msg": "Create an account first"}
    
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Fri Jun 30 18:25:16 UTC 2023
    - 2.1K bytes
    - Viewed (0)
Back to top