Files
sshecret/packages/sshecret-sshd/tests/test_ping.py

16 lines
533 B
Python

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"