wohnbot/tests/test_autoclean.py

28 lines
815 B
Python
Raw Normal View History

2026-01-01 15:27:25 +01:00
import pytest
import sys
from pathlib import Path
from datetime import datetime, timedelta
sys.path.append(str(Path(__file__).parent.parent))
@pytest.fixture
def temp_data_dir(tmp_path):
"""Create a temporary data directory with test files."""
data_dir = tmp_path / "data"
data_dir.mkdir()
return data_dir
def test_autoclean_script_exists():
"""Test that the autoclean script exists and is valid Python."""
script_path = Path(__file__).parent.parent / "autoclean_debug.py"
assert script_path.exists()
# Verify it's valid Python
with open(script_path, 'r', encoding='utf-8') as f:
code = f.read()
try:
compile(code, 'autoclean_debug.py', 'exec')
except SyntaxError as e:
pytest.fail(f"Syntax error in autoclean_debug.py: {e}")