Centralize testing
This commit is contained in:
18
tests/packages/sshd/test_ping.py
Normal file
18
tests/packages/sshd/test_ping.py
Normal file
@ -0,0 +1,18 @@
|
||||
import pytest
|
||||
|
||||
from .types import ClientRegistry, CommandRunner
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_ping_command(
|
||||
ssh_command_runner: CommandRunner, client_registry: ClientRegistry
|
||||
) -> None:
|
||||
# Register a test client with default policies and no secrets
|
||||
await client_registry["add_client"]("test-pinger")
|
||||
|
||||
result = await ssh_command_runner("test-pinger", "ping")
|
||||
|
||||
assert result.exit_status == 0
|
||||
assert result.stdout is not None
|
||||
assert isinstance(result.stdout, str)
|
||||
assert result.stdout.rstrip() == "PONG"
|
||||
Reference in New Issue
Block a user