"""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 """ Test Feed 2025-01-01T00:00:00Z Test Author author@example.com https://example.com/ Test Entry https://example.com/entry/1 2025-01-01T00:00:00Z This is a test entry. This is the content of the test entry.

]]>
""" @pytest.fixture def sample_rss_feed(): """Sample RSS feed XML for testing.""" return """ Test RSS Feed https://example.com/ Test RSS feed for testing editor@example.com Test RSS Entry https://example.com/rss/entry/1 This is a test RSS entry. Mon, 01 Jan 2025 00:00:00 GMT https://example.com/rss/entry/1 """