Centralize testing
This commit is contained in:
29
tests/integration/types.py
Normal file
29
tests/integration/types.py
Normal file
@ -0,0 +1,29 @@
|
||||
"""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]]:
|
||||
...
|
||||
Reference in New Issue
Block a user