Files
sshctl/tests/test_validator.py
T

22 lines
591 B
Python
Raw Normal View History

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