mirror of
https://github.com/apache/superset.git
synced 2026-04-19 08:04:53 +00:00
feat(ssh_tunnel): Add feature flag to SSH Tunnel API (#22805)
This commit is contained in:
committed by
GitHub
parent
0045816772
commit
d6a4a5da79
@@ -18,6 +18,7 @@
|
||||
from typing import Iterator
|
||||
|
||||
import pytest
|
||||
from pytest_mock import MockFixture
|
||||
from sqlalchemy.orm.session import Session
|
||||
|
||||
|
||||
@@ -50,7 +51,9 @@ def session_with_data(session: Session) -> Iterator[Session]:
|
||||
session.rollback()
|
||||
|
||||
|
||||
def test_delete_ssh_tunnel_command(session_with_data: Session) -> None:
|
||||
def test_delete_ssh_tunnel_command(
|
||||
mocker: MockFixture, session_with_data: Session
|
||||
) -> None:
|
||||
from superset.databases.dao import DatabaseDAO
|
||||
from superset.databases.ssh_tunnel.commands.delete import DeleteSSHTunnelCommand
|
||||
from superset.databases.ssh_tunnel.models import SSHTunnel
|
||||
@@ -60,9 +63,11 @@ def test_delete_ssh_tunnel_command(session_with_data: Session) -> None:
|
||||
assert result
|
||||
assert isinstance(result, SSHTunnel)
|
||||
assert 1 == result.database_id
|
||||
|
||||
mocker.patch(
|
||||
"superset.databases.ssh_tunnel.commands.delete.is_feature_enabled",
|
||||
return_value=True,
|
||||
)
|
||||
DeleteSSHTunnelCommand(1).run()
|
||||
|
||||
result = DatabaseDAO.get_ssh_tunnel(1)
|
||||
|
||||
assert result is None
|
||||
|
||||
Reference in New Issue
Block a user