Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions pytest.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[pytest]
testpaths = tests
python_files = test_*.py
python_classes = Test*
python_functions = test_*
2 changes: 2 additions & 0 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
pytest>=7.0.0
pytest-cov>=4.0.0
32 changes: 32 additions & 0 deletions tests/test_check.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
"""Unit tests for check.py script."""

import sys
from pathlib import Path

# Add scripts directory to path for imports
sys.path.insert(0, str(Path(__file__).parent.parent / "scripts"))


def test_rel_function():
"""Test the rel() function converts paths correctly."""
# Import after path is set up
import check

root = Path("/Users/test/financial-services")
check.ROOT = root

test_path = Path("/Users/test/financial-services/plugins/test/file.md")
result = check.rel(test_path)

assert result == "plugins/test/file.md"


def test_err_function():
"""Test the err() function appends to errors list."""
import check

check.errors = []
check.err("test error")

assert len(check.errors) == 1
assert check.errors[0] == "test error"