36 lines
No EOL
1.2 KiB
Python
36 lines
No EOL
1.2 KiB
Python
import os
|
|
import sys
|
|
import json
|
|
|
|
# Add parent directory to path
|
|
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
|
|
|
|
# Set environment variable to use our test .env
|
|
os.environ['ENV_FILE'] = os.path.join(os.path.dirname(__file__), 'env.test.txt')
|
|
|
|
print(f"Using env file: {os.environ['ENV_FILE']}")
|
|
|
|
try:
|
|
print("Attempting to import config...")
|
|
from app.core.config import settings
|
|
|
|
print("✓ Config import successful!")
|
|
print(f" DEBUG: {settings.debug}")
|
|
print(f" LOG_LEVEL: {settings.log_level}")
|
|
print(f" HOST: {settings.host}")
|
|
print(f" PORT: {settings.port}")
|
|
print(f" OAUTH2_SUPPORTED_SCOPES: {settings.oauth2_supported_scopes}")
|
|
print(f" OAUTH2_SUPPORTED_GRANT_TYPES: {settings.oauth2_supported_grant_types}")
|
|
print(f" Type of scopes: {type(settings.oauth2_supported_scopes)}")
|
|
print(f" Type of grant types: {type(settings.oauth2_supported_grant_types)}")
|
|
|
|
# Test JSON serialization
|
|
print(f" Scopes as JSON: {json.dumps(settings.oauth2_supported_scopes)}")
|
|
|
|
print("✓ All configuration tests passed!")
|
|
|
|
except Exception as e:
|
|
print(f"✗ Config import failed: {e}")
|
|
import traceback
|
|
traceback.print_exc()
|
|
sys.exit(1) |