wohnbot/tests/test_helper_functions.py

38 lines
1.2 KiB
Python
Raw Permalink Normal View History

2026-01-01 15:27:25 +01:00
import pytest
import sys
from pathlib import Path
sys.path.append(str(Path(__file__).parent.parent))
def test_merge_scripts_exist():
"""Test that all merge helper scripts exist."""
helper_dir = Path(__file__).parent.parent / "helper_functions"
assert (helper_dir / "merge_listing_times.py").exists()
assert (helper_dir / "merge_applications.py").exists()
assert (helper_dir / "merge_dict_json.py").exists()
assert (helper_dir / "merge_wgcompany_times.py").exists()
def test_merge_scripts_are_python_files():
"""Test that all merge scripts are valid Python files."""
helper_dir = Path(__file__).parent.parent / "helper_functions"
scripts = [
"merge_listing_times.py",
"merge_applications.py",
"merge_dict_json.py",
"merge_wgcompany_times.py"
]
for script in scripts:
script_path = helper_dir / script
assert script_path.exists()
# Verify it's a Python file by checking it can be compiled
with open(script_path, 'r', encoding='utf-8') as f:
code = f.read()
try:
compile(code, script, 'exec')
except SyntaxError as e:
pytest.fail(f"Syntax error in {script}: {e}")