flakestorm/tests/conftest.py
Entropix 61652be09b Refactor Entropix to FlakeStorm
- Rename all instances of Entropix to FlakeStorm
- Rename package from entropix to flakestorm
- Update all class names (EntropixConfig -> FlakeStormConfig, EntropixRunner -> FlakeStormRunner)
- Update Rust module from entropix_rust to flakestorm_rust
- Update README: remove cloud comparison, update links to flakestorm.com
- Update .gitignore to allow docs files referenced in README
- Add origin remote for VS Code compatibility
- Fix missing imports and type references
- All imports and references updated throughout codebase
2025-12-29 11:15:18 +08:00

78 lines
1.4 KiB
Python

"""Shared test fixtures for flakestorm tests."""
import sys
import tempfile
from pathlib import Path
import pytest
# Add src to path for imports
sys.path.insert(0, str(Path(__file__).parent.parent / "src"))
@pytest.fixture
def temp_dir():
"""Create a temporary directory."""
with tempfile.TemporaryDirectory() as tmpdir:
yield Path(tmpdir)
@pytest.fixture
def sample_config_yaml():
"""Sample valid config YAML."""
return """
agent:
endpoint: "http://localhost:8000/chat"
type: http
timeout: 30
golden_prompts:
- "Test prompt 1"
- "Test prompt 2"
mutations:
count: 5
types:
- paraphrase
- noise
invariants:
- type: latency
max_ms: 5000
"""
@pytest.fixture
def config_file(temp_dir, sample_config_yaml):
"""Create a config file in temp directory."""
config_path = temp_dir / "flakestorm.yaml"
config_path.write_text(sample_config_yaml)
return config_path
@pytest.fixture
def minimal_config_yaml():
"""Minimal valid config YAML."""
return """
agent:
endpoint: "http://localhost:8000/chat"
type: http
golden_prompts:
- "Test prompt"
mutations:
count: 2
types:
- paraphrase
invariants: []
"""
@pytest.fixture
def minimal_config_file(temp_dir, minimal_config_yaml):
"""Create a minimal config file."""
config_path = temp_dir / "flakestorm.yaml"
config_path.write_text(minimal_config_yaml)
return config_path