def test_no_scopes( mocker: MockFixture, flask_app: Flask, authenticator: Auth0Authenticator, access_token: str, ): mock_valid_time(mocker) with flask_app.test_request_context( headers={"Authorization": f"Bearer {access_token}"}): authenticator.with_scopes([]).authenticate()
def test_missing_scopes( mocker: MockFixture, flask_app: Flask, authenticator: Auth0Authenticator, access_token: str, ): mock_valid_time(mocker) with flask_app.test_request_context( headers={"Authorization": f"Bearer {access_token}"}): with pytest.raises(errors.Forbidden): authenticator.with_scopes(["read:location", "write:location"]).authenticate()