Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 36 for nonexistent (0.2 sec)

  1. docs_src/app_testing/app_b/test_main.py

        response = client.get("/items/foo", headers={"X-Token": "hailhydra"})
        assert response.status_code == 400
        assert response.json() == {"detail": "Invalid X-Token header"}
    
    
    def test_read_nonexistent_item():
        response = client.get("/items/baz", headers={"X-Token": "coneofsilence"})
        assert response.status_code == 404
        assert response.json() == {"detail": "Item not found"}
    
    
    def test_create_item():
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Wed Mar 13 19:07:10 GMT 2024
    - 1.8K bytes
    - Viewed (0)
  2. tests/test_tutorial/test_testing/test_main_b_an_py310.py

    def test_app():
        from docs_src.app_testing.app_b_an_py310 import test_main
    
        test_main.test_create_existing_item()
        test_main.test_create_item()
        test_main.test_create_item_bad_token()
        test_main.test_read_nonexistent_item()
        test_main.test_read_item()
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Wed Mar 13 19:07:10 GMT 2024
    - 360 bytes
    - Viewed (0)
  3. tests/test_tutorial/test_testing/test_main_b_an.py

    from docs_src.app_testing.app_b_an import test_main
    
    
    def test_app():
        test_main.test_create_existing_item()
        test_main.test_create_item()
        test_main.test_create_item_bad_token()
        test_main.test_read_nonexistent_item()
        test_main.test_read_item()
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Wed Mar 13 19:07:10 GMT 2024
    - 303 bytes
    - Viewed (1)
  4. tests/test_tutorial/test_security/test_tutorial005_py39.py

            "email": "******@****.***",
            "disabled": False,
        }
    
    
    @needs_py39
    def test_incorrect_token(client: TestClient):
        response = client.get("/users/me", headers={"Authorization": "Bearer nonexistent"})
        assert response.status_code == 401, response.text
        assert response.json() == {"detail": "Could not validate credentials"}
        assert response.headers["WWW-Authenticate"] == 'Bearer scope="me"'
    
    
    @needs_py39
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Wed Mar 13 19:07:10 GMT 2024
    - 16.3K bytes
    - Viewed (0)
  5. docs_src/app_testing/app_b_an/test_main.py

        response = client.get("/items/foo", headers={"X-Token": "hailhydra"})
        assert response.status_code == 400
        assert response.json() == {"detail": "Invalid X-Token header"}
    
    
    def test_read_nonexistent_item():
        response = client.get("/items/baz", headers={"X-Token": "coneofsilence"})
        assert response.status_code == 404
        assert response.json() == {"detail": "Item not found"}
    
    
    def test_create_item():
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Wed Mar 13 19:07:10 GMT 2024
    - 1.8K bytes
    - Viewed (0)
  6. tests/test_tutorial/test_security/test_tutorial005_an_py39.py

            "email": "******@****.***",
            "disabled": False,
        }
    
    
    @needs_py39
    def test_incorrect_token(client: TestClient):
        response = client.get("/users/me", headers={"Authorization": "Bearer nonexistent"})
        assert response.status_code == 401, response.text
        assert response.json() == {"detail": "Could not validate credentials"}
        assert response.headers["WWW-Authenticate"] == 'Bearer scope="me"'
    
    
    @needs_py39
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Wed Mar 13 19:07:10 GMT 2024
    - 16.3K bytes
    - Viewed (0)
  7. tests/test_tutorial/test_security/test_tutorial005_py310.py

            "email": "******@****.***",
            "disabled": False,
        }
    
    
    @needs_py310
    def test_incorrect_token(client: TestClient):
        response = client.get("/users/me", headers={"Authorization": "Bearer nonexistent"})
        assert response.status_code == 401, response.text
        assert response.json() == {"detail": "Could not validate credentials"}
        assert response.headers["WWW-Authenticate"] == 'Bearer scope="me"'
    
    
    @needs_py310
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Wed Mar 13 19:07:10 GMT 2024
    - 16.3K bytes
    - Viewed (0)
  8. tests/test_tutorial/test_security/test_tutorial005_an.py

        assert response.status_code == 401, response.text
        assert response.json() == {"detail": "Could not validate credentials"}
        assert response.headers["WWW-Authenticate"] == 'Bearer scope="me"'
    
    
    def test_incorrect_token_type():
        response = client.get(
            "/users/me", headers={"Authorization": "Notexistent testtoken"}
        )
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Wed Mar 13 19:07:10 GMT 2024
    - 15.4K bytes
    - Viewed (0)
  9. tests/test_tutorial/test_sql_databases/test_sql_databases.py

        assert response.status_code == 200, response.text
        data = response.json()
        assert "email" in data
        assert "id" in data
    
    
    # TODO: pv2 add version with Pydantic v2
    @needs_pydanticv1
    def test_nonexistent_user(client):
        response = client.get("/users/999")
        assert response.status_code == 404, response.text
    
    
    # TODO: pv2 add version with Pydantic v2
    @needs_pydanticv1
    def test_get_users(client):
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Wed Mar 13 19:07:10 GMT 2024
    - 16.1K bytes
    - Viewed (0)
  10. tests/test_tutorial/test_sql_databases/test_sql_databases_middleware_py310.py

        data = response.json()
        assert "email" in data
        assert "id" in data
    
    
    @needs_py310
    # TODO: pv2 add version with Pydantic v2
    @needs_pydanticv1
    def test_nonexistent_user(client):
        response = client.get("/users/999")
        assert response.status_code == 404, response.text
    
    
    @needs_py310
    # TODO: pv2 add version with Pydantic v2
    @needs_pydanticv1
    def test_get_users(client):
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Wed Mar 13 19:07:10 GMT 2024
    - 16.5K bytes
    - Viewed (0)
Back to top