Added pytest + some tests.

Added AWS S3 Support (optional, for cloud image storage)
This commit is contained in:
George Khananaev
2025-06-03 00:12:11 +07:00
parent 84399dfbe8
commit 50aaa9ce26
9 changed files with 755 additions and 5 deletions

39
tests/conftest.py Normal file
View File

@@ -0,0 +1,39 @@
"""
Test configuration and fixtures for Google Reviews Scraper tests.
"""
import pytest
import yaml
from pathlib import Path
@pytest.fixture
def config():
"""Load configuration from config.yaml"""
config_path = Path(__file__).parent.parent / "config.yaml"
with open(config_path, 'r') as f:
return yaml.safe_load(f)
@pytest.fixture
def mongodb_config(config):
"""Extract MongoDB configuration"""
return config.get("mongodb", {})
@pytest.fixture
def s3_config(config):
"""Extract S3 configuration"""
return config.get("s3", {})
@pytest.fixture
def use_mongodb(config):
"""Check if MongoDB is enabled"""
return config.get("use_mongodb", False)
@pytest.fixture
def use_s3(config):
"""Check if S3 is enabled"""
return config.get("use_s3", False)