Complete sshd package with tests
This commit is contained in:
15
packages/sshecret-sshd/tests/test_ping.py
Normal file
15
packages/sshecret-sshd/tests/test_ping.py
Normal file
@ -0,0 +1,15 @@
|
||||
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