test: add unit tests for core, parser and operations
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from pathlib import Path
|
||||
|
||||
from sshctl.config.validator import validate_config
|
||||
|
||||
|
||||
def test_validate_nonexistent(tmp_path: Path) -> None:
|
||||
result = validate_config(tmp_path / "nonexistent")
|
||||
assert not result.passed
|
||||
assert any("not found" in i.message for i in result.issues)
|
||||
|
||||
|
||||
def test_validate_valid(sample_config: Path) -> None:
|
||||
result = validate_config(sample_config)
|
||||
assert result.passed
|
||||
|
||||
|
||||
def test_validate_with_includes(config_with_includes: Path) -> None:
|
||||
result = validate_config(config_with_includes)
|
||||
assert result.passed
|
||||
Reference in New Issue
Block a user