"""Test configuration and fixtures for thicket."""
import tempfile
from pathlib import Path
import pytest
from thicket.models import ThicketConfig, UserConfig
@pytest.fixture
def temp_dir():
"""Create a temporary directory for tests."""
with tempfile.TemporaryDirectory() as tmp_dir:
yield Path(tmp_dir)
@pytest.fixture
def sample_config(temp_dir):
"""Create a sample configuration for testing."""
git_store = temp_dir / "git_store"
cache_dir = temp_dir / "cache"
return ThicketConfig(
git_store=git_store,
cache_dir=cache_dir,
users=[
UserConfig(
username="testuser",
feeds=["https://example.com/feed.xml"],
email="test@example.com",
display_name="Test User",
)
],
)
@pytest.fixture
def sample_atom_feed():
"""Sample Atom feed XML for testing."""
return """