chore: Remove database ID dependency for SSH Tunnel creation (#26989)

This commit is contained in:
Geido
2024-02-07 18:03:19 +02:00
committed by GitHub
parent 43e1dc49c9
commit d8e26cfff1
6 changed files with 51 additions and 73 deletions

View File

@@ -37,7 +37,7 @@ def test_create_ssh_tunnel_command() -> None:
"password": "bar",
}
result = CreateSSHTunnelCommand(db.id, properties).run()
result = CreateSSHTunnelCommand(db, properties).run()
assert result is not None
assert isinstance(result, SSHTunnel)
@@ -53,14 +53,14 @@ def test_create_ssh_tunnel_command_invalid_params() -> None:
# If we are trying to create a tunnel with a private_key_password
# then a private_key is mandatory
properties = {
"database_id": db.id,
"database": db,
"server_address": "123.132.123.1",
"server_port": "3005",
"username": "foo",
"private_key_password": "bar",
}
command = CreateSSHTunnelCommand(db.id, properties)
command = CreateSSHTunnelCommand(db, properties)
with pytest.raises(SSHTunnelInvalidError) as excinfo:
command.run()