test: add unit tests for core, parser and operations
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import structlog
|
||||
|
||||
from sshctl.core.logutil import get_logger, setup_logging
|
||||
|
||||
|
||||
def test_setup_logging_plain() -> None:
|
||||
setup_logging(verbose=False)
|
||||
assert structlog.is_configured() is True
|
||||
logger = get_logger("test")
|
||||
assert logger is not None
|
||||
|
||||
|
||||
def test_setup_logging_verbose() -> None:
|
||||
setup_logging(verbose=True)
|
||||
assert structlog.is_configured() is True
|
||||
|
||||
|
||||
def test_get_logger_cached() -> None:
|
||||
setup_logging(verbose=True)
|
||||
first = get_logger("cache-test")
|
||||
second = get_logger("cache-test")
|
||||
assert first is second
|
||||
Reference in New Issue
Block a user