Files
clan-core/pkgs/clan-cli/clan_cli/tests/hosts.py
Jörg Thalheim 3d83017acd make host key check an enum instead of an literal type
this is more typesafe at runtime.
2025-07-04 14:36:05 +02:00

26 lines
555 B
Python

import os
import pwd
from pathlib import Path
import pytest
from clan_cli.tests.sshd import Sshd
from clan_lib.ssh.host_key import HostKeyCheck
from clan_lib.ssh.remote import Remote
@pytest.fixture
def hosts(sshd: Sshd) -> list[Remote]:
login = pwd.getpwuid(os.getuid()).pw_name
group = [
Remote(
"127.0.0.1",
port=sshd.port,
user=login,
private_key=Path(sshd.key),
host_key_check=HostKeyCheck.NONE,
command_prefix="local_test",
)
]
return group