Spaces:
Sleeping
Sleeping
File size: 1,717 Bytes
420bcec |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 |
"""Pytest configuration and fixtures."""
import pytest
import os
from pathlib import Path
import tempfile
import shutil
@pytest.fixture
def sample_meeting_md():
"""Sample meeting markdown content."""
return """# Meeting: Sprint Planning
Date: 2025-01-15
Participants: Alice, Bob, Charlie
## Discussion
We discussed the new feature requirements and timeline.
The team agreed on the architecture approach.
## Decisions
- Use PostgreSQL for the database
- Deploy on AWS ECS
## Action Items
- [ ] Alice: Implement login page by 2025-01-20
- [ ] Bob: Set up CI/CD pipeline by 2025-01-18
- [x] Charlie: Review requirements (completed)
## Blockers
- Waiting for API credentials from vendor
- Need design approval from stakeholders
"""
@pytest.fixture
def temp_data_dir(sample_meeting_md):
"""Create a temporary data directory with sample meetings."""
temp_dir = tempfile.mkdtemp()
data_dir = Path(temp_dir) / "data"
# Create project structure
project_dir = data_dir / "test_project" / "meetings"
project_dir.mkdir(parents=True)
# Write sample meeting
meeting_file = project_dir / "2025-01-15-sprint-planning.md"
meeting_file.write_text(sample_meeting_md)
yield data_dir
# Cleanup
shutil.rmtree(temp_dir)
@pytest.fixture
def hf_token():
"""Get HuggingFace token from environment."""
token = os.getenv("HF_TOKEN")
if not token:
pytest.skip("HF_TOKEN not set - skipping HuggingFace tests")
return token
@pytest.fixture
def google_api_key():
"""Get Google API key from environment."""
key = os.getenv("GOOGLE_API_KEY")
if not key:
pytest.skip("GOOGLE_API_KEY not set - skipping Google API tests")
return key
|