test: add unit tests for core, parser and operations
This commit is contained in:
@@ -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"
|
||||
Reference in New Issue
Block a user