Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ def function_decorated():
mock_call()


@pytest.mark.db_test
class TestBasicAuth:
def setup_method(self) -> None:
mock_call.reset_mock()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ def function_decorated():
mock_call()


@pytest.mark.db_test
class TestSessionAuth:
def setup_method(self) -> None:
mock_call.reset_mock()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,9 @@

from unittest.mock import patch

import pytest

from airflow.providers.fab.auth_manager.api_fastapi.datamodels.login import LoginBody, LoginResponse


@pytest.mark.db_test
class TestLogin:
dummy_login_body = LoginBody(username="dummy", password="dummy")
dummy_token = LoginResponse(access_token="DUMMY_TOKEN")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
from airflow.providers.fab.auth_manager.api_fastapi.datamodels.login import LoginResponse


@pytest.mark.db_test
@patch("airflow.providers.fab.auth_manager.api_fastapi.services.login.get_auth_manager")
class TestLogin:
def setup_method(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@
with ignore_provider_compatibility_error("2.9.0+", __file__):
from airflow.providers.fab.auth_manager.cli_commands.utils import get_application_builder

pytestmark = pytest.mark.db_test


@pytest.fixture
def flask_app():
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,6 @@ def test_serialize_user(self, flask_app, auth_manager_with_appbuilder):
result = auth_manager_with_appbuilder.serialize_user(user)
assert result == {"sub": str(user.id)}

@pytest.mark.db_test
@mock.patch.object(FabAuthManager, "get_user")
def test_is_logged_in(self, mock_get_user, auth_manager_with_appbuilder):
user = Mock()
Expand All @@ -163,7 +162,6 @@ def test_is_logged_in(self, mock_get_user, auth_manager_with_appbuilder):

assert auth_manager_with_appbuilder.is_logged_in() is False

@pytest.mark.db_test
@mock.patch.object(FabAuthManager, "get_user")
def test_is_logged_in_with_inactive_user(self, mock_get_user, auth_manager_with_appbuilder):
user = Mock()
Expand Down Expand Up @@ -690,19 +688,16 @@ def test_get_authorized_dag_ids(

delete_user(flask_app, "username")

@pytest.mark.db_test
def test_security_manager_return_fab_security_manager_override(self, auth_manager_with_appbuilder):
assert isinstance(auth_manager_with_appbuilder.security_manager, FabAirflowSecurityManagerOverride)

@pytest.mark.db_test
def test_security_manager_return_custom_provided(self, flask_app, auth_manager_with_appbuilder):
class TestSecurityManager(FabAirflowSecurityManagerOverride):
pass

flask_app.config["SECURITY_MANAGER_CLASS"] = TestSecurityManager
assert isinstance(auth_manager_with_appbuilder.security_manager, TestSecurityManager)

@pytest.mark.db_test
def test_security_manager_wrong_inheritance_raise_exception(
self, flask_app, auth_manager_with_appbuilder
):
Expand Down
Loading