Files
sshecret/tests/integration/types.py
2025-05-11 11:22:00 +02:00

30 lines
626 B
Python

"""Typings."""
import asyncssh
from typing import Any, AsyncContextManager, Protocol
from dataclasses import dataclass
from collections.abc import Callable, Awaitable
from .clients import ClientData
PortFactory = Callable[[], int]
@dataclass
class TestPorts:
"""Test port dataclass."""
backend: int
admin: int
sshd: int
CommandRunner = Callable[[ClientData, str], Awaitable[asyncssh.SSHCompletedProcess]]
class ProcessRunner(Protocol):
"""Process runner typing."""
def __call__(self, test_client: ClientData, command: str) -> AsyncContextManager[asyncssh.SSHClientProcess[Any]]:
...