Spaces:
Runtime error
Runtime error
Create tests/__init__.py
Browse files- tests/__init__.py +37 -0
tests/__init__.py
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""
|
| 2 |
+
Test package initialization.
|
| 3 |
+
Contains test configuration and shared fixtures.
|
| 4 |
+
"""
|
| 5 |
+
|
| 6 |
+
import os
|
| 7 |
+
import sys
|
| 8 |
+
import pytest
|
| 9 |
+
|
| 10 |
+
# Add parent directory to path for importing application modules
|
| 11 |
+
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
|
| 12 |
+
|
| 13 |
+
# Test configuration
|
| 14 |
+
TEST_CONFIG = {
|
| 15 |
+
'GITHUB_TOKEN': 'test_github_token',
|
| 16 |
+
'PRODUCT_HUNT_TOKEN': 'test_producthunt_token',
|
| 17 |
+
'REDDIT_CLIENT_ID': 'test_reddit_client_id',
|
| 18 |
+
'REDDIT_CLIENT_SECRET': 'test_reddit_secret',
|
| 19 |
+
'REDDIT_USER_AGENT': 'test_reddit_agent'
|
| 20 |
+
}
|
| 21 |
+
|
| 22 |
+
# Common pytest fixtures
|
| 23 |
+
@pytest.fixture
|
| 24 |
+
def mock_credentials():
|
| 25 |
+
"""Fixture to provide mock credentials for testing."""
|
| 26 |
+
return {
|
| 27 |
+
'project_id': 'test-project',
|
| 28 |
+
'credentials_path': '/path/to/test/credentials.json'
|
| 29 |
+
}
|
| 30 |
+
|
| 31 |
+
@pytest.fixture
|
| 32 |
+
def mock_model():
|
| 33 |
+
"""Fixture to provide mock Gemini model for testing."""
|
| 34 |
+
class MockModel:
|
| 35 |
+
def generate_content(self, prompt):
|
| 36 |
+
return type('Response', (), {'text': 'Test response'})()
|
| 37 |
+
return MockModel()
|