"""
Pytest configuration and shared fixtures for Woseco tests.
"""
import pytest
import pandas as pd
from pathlib import Path


@pytest.fixture
def sample_stories_df():
    """Create a sample DataFrame with stories for testing."""
    return pd.DataFrame({
        'Story': [
            'There was a belief in the village. The faith helped people cope.',
            'The gloom settled over the city. A payment was due soon.',
            'Music filled the air. The song brought joy to everyone.'
        ],
        'prompt': [
            'belief-faith-sing',
            'gloom-payment-exist',
            'music-song-joy'
        ],
        'rating': [4, 3, 5]
    })


@pytest.fixture
def sample_concepts():
    """Sample concept lists for testing."""
    return [
        ['belief', 'faith', 'people'],
        ['gloom', 'city', 'payment'],
        ['music', 'air', 'song', 'joy']
    ]


@pytest.fixture
def sample_csv_file(tmp_path, sample_stories_df):
    """Create a temporary CSV file with sample data."""
    csv_file = tmp_path / "test_stories.csv"
    sample_stories_df.to_csv(csv_file, index=False)
    return csv_file


@pytest.fixture
def empty_df():
    """Create an empty DataFrame."""
    return pd.DataFrame()


@pytest.fixture
def temp_output_dir(tmp_path):
    """Create a temporary output directory."""
    output_dir = tmp_path / "output"
    output_dir.mkdir()
    return output_dir
