"""
Pytest configuration and fixtures for juiceKEGGers tests
"""
import pytest
import tempfile
import shutil
from pathlib import Path
import sys
import os

# Add source to path
sys.path.insert(0, str(Path(__file__).parent.parent))


@pytest.fixture
def temp_dir():
    """Create a temporary directory for tests."""
    tmpdir = tempfile.mkdtemp(prefix="juicekeggers_test_")
    yield Path(tmpdir)
    # Cleanup
    if Path(tmpdir).exists():
        shutil.rmtree(tmpdir)


# Update in tests/conftest.py

@pytest.fixture
def test_data_dir():
    """Get test data directory."""
    return Path(__file__).parent / "test_data"


@pytest.fixture
def sample_organisms_tsv(test_data_dir):
    """Get sample organisms.tsv file."""
    return test_data_dir / "test_organisms.tsv"


@pytest.fixture  
def sample_fasta_file(test_data_dir):
    """Get sample FASTA file."""
    return test_data_dir / "test_small.fasta"


@pytest.fixture
def sample_keg_file(test_data_dir):
    """Get sample .keg file."""
    return test_data_dir / "test_small.keg"


@pytest.fixture
def sample_annotations_tsv(test_data_dir):
    """Get sample annotations file."""
    return test_data_dir / "test_annotations.tsv"


@pytest.fixture
def sample_taxonomy_tsv(test_data_dir):
    """Get sample taxonomy file."""
    return test_data_dir / "test_taxonomy.tsv"


@pytest.fixture
def sample_kegg_organisms_keg(test_data_dir):
    """Get sample KEGG organisms file."""
    return test_data_dir / "test_kegg_organisms.keg"
    