mirror of
https://github.com/apache/superset.git
synced 2026-04-19 08:04:53 +00:00
chore: set up ruff as a new linter/formatter (#28158)
This commit is contained in:
committed by
GitHub
parent
e8a678b75a
commit
2d63722150
@@ -28,8 +28,6 @@ from superset.commands.dataset.exceptions import (
|
||||
)
|
||||
from superset.commands.exceptions import (
|
||||
DatasourceNotFoundValidationError,
|
||||
DatasourceTypeInvalidError,
|
||||
OwnersNotFoundValidationError,
|
||||
QueryNotFoundValidationError,
|
||||
)
|
||||
from superset.exceptions import SupersetSecurityException
|
||||
@@ -242,11 +240,11 @@ def test_dataset_has_access(mocker: MockFixture) -> None:
|
||||
mocker.patch(is_owner, return_value=False)
|
||||
mocker.patch(can_access, return_value=True)
|
||||
assert (
|
||||
check_datasource_access(
|
||||
check_datasource_access( # noqa: E712
|
||||
datasource_id=1,
|
||||
datasource_type=DatasourceType.TABLE,
|
||||
)
|
||||
== True
|
||||
is True
|
||||
)
|
||||
|
||||
|
||||
@@ -260,18 +258,17 @@ def test_query_has_access(mocker: MockFixture) -> None:
|
||||
mocker.patch(is_owner, return_value=False)
|
||||
mocker.patch(can_access, return_value=True)
|
||||
assert (
|
||||
check_datasource_access(
|
||||
check_datasource_access( # noqa: E712
|
||||
datasource_id=1,
|
||||
datasource_type=DatasourceType.QUERY,
|
||||
)
|
||||
== True
|
||||
is True
|
||||
)
|
||||
|
||||
|
||||
def test_query_no_access(mocker: MockFixture, client) -> None:
|
||||
from superset.connectors.sqla.models import SqlaTable
|
||||
from superset.explore.utils import check_datasource_access
|
||||
from superset.models.core import Database
|
||||
from superset.models.sql_lab import Query
|
||||
|
||||
database = mocker.MagicMock()
|
||||
|
||||
Reference in New Issue
Block a user