shreyashreya's picture
Create tests/__init__.py
8fe6cee verified
raw
history blame
1.04 kB
"""
Test package initialization.
Contains test configuration and shared fixtures.
"""
import os
import sys
import pytest
# Add parent directory to path for importing application modules
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
# Test configuration
TEST_CONFIG = {
'GITHUB_TOKEN': 'test_github_token',
'PRODUCT_HUNT_TOKEN': 'test_producthunt_token',
'REDDIT_CLIENT_ID': 'test_reddit_client_id',
'REDDIT_CLIENT_SECRET': 'test_reddit_secret',
'REDDIT_USER_AGENT': 'test_reddit_agent'
}
# Common pytest fixtures
@pytest.fixture
def mock_credentials():
"""Fixture to provide mock credentials for testing."""
return {
'project_id': 'test-project',
'credentials_path': '/path/to/test/credentials.json'
}
@pytest.fixture
def mock_model():
"""Fixture to provide mock Gemini model for testing."""
class MockModel:
def generate_content(self, prompt):
return type('Response', (), {'text': 'Test response'})()
return MockModel()