add host_group fixture

This commit is contained in:
Jörg Thalheim
2023-08-10 12:39:26 +02:00
parent b3a665cb19
commit 2a31b1d65b
3 changed files with 43 additions and 45 deletions

View File

@@ -0,0 +1,23 @@
import os
import pwd
import pytest
from sshd import Sshd
from clan_cli.ssh import Host, HostGroup, HostKeyCheck
@pytest.fixture
def host_group(sshd: Sshd) -> HostGroup:
login = pwd.getpwuid(os.getuid()).pw_name
return HostGroup(
[
Host(
"127.0.0.1",
port=sshd.port,
user=login,
key=sshd.key,
host_key_check=HostKeyCheck.NONE,
)
]
)