Spaces:
Sleeping
Sleeping
File size: 1,036 Bytes
8fe6cee | 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 | """
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() |