test: add unit tests for core, parser and operations

This commit is contained in:
ahp
2026-09-12 13:47:31 +03:30
parent b23abdb2d0
commit e3a01c4d3a
18 changed files with 1651 additions and 0 deletions
+25
View File
@@ -0,0 +1,25 @@
from __future__ import annotations
from sshctl.core.exceptions import (
ConfigError,
ParseError,
ResolverError,
SshctlError,
)
def test_exception_hierarchy() -> None:
assert issubclass(ConfigError, SshctlError)
assert issubclass(ParseError, SshctlError)
assert issubclass(ResolverError, SshctlError)
def test_sshctl_error_is_base() -> None:
assert issubclass(SshctlError, Exception)
def test_exception_raised() -> None:
try:
raise ConfigError("test error")
except SshctlError as e:
assert str(e) == "test error"