-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtest_config.py
More file actions
68 lines (55 loc) · 2.2 KB
/
Copy pathtest_config.py
File metadata and controls
68 lines (55 loc) · 2.2 KB
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#!/usr/bin/env python3
import sys
import os
# Add src directory to Python path
sys.path.insert(0, os.path.join(os.path.dirname(__file__), 'src'))
# Now import and test the configuration
from app.libs.application.application_context import Configuration # noqa: E402
def test_configuration():
print("Testing Configuration Loading...")
print("=" * 50)
config = Configuration()
# Print all configuration values
config_values = {
"app_logging_enable": config.app_logging_enable,
"app_logging_level": config.app_logging_level,
"azure_package_logging_level": config.azure_package_logging_level,
"azure_logging_packages": config.azure_logging_packages,
"cosmos_db_account_url": config.cosmos_db_account_url,
"cosmos_db_database_name": config.cosmos_db_database_name,
"cosmos_db_process_container": config.cosmos_db_process_container,
"storage_account_name": config.storage_account_name,
"storage_account_blob_url": config.storage_account_blob_url,
"storage_account_queue_url": config.storage_account_queue_url,
"storage_account_process_container": config.storage_account_process_container,
"storage_account_process_queue": getattr(config, 'storage_account_process_queue', 'MISSING'),
}
for key, value in config_values.items():
print(f"{key}: {value}")
if value is None:
print(f" ❌ {key} is None!")
elif value == "":
print(f" ❌ {key} is empty string!")
else:
print(f" ✅ {key} has value")
print("\n" + "=" * 50)
print("Checking Environment Variables...")
env_vars = [
"APP_CONFIGURATION_URL",
"COSMOS_DB_ACCOUNT_URL",
"COSMOS_DB_DATABASE_NAME",
"COSMOS_DB_PROCESS_CONTAINER",
"STORAGE_ACCOUNT_NAME",
"STORAGE_ACCOUNT_BLOB_URL",
"STORAGE_ACCOUNT_QUEUE_URL",
"STORAGE_ACCOUNT_PROCESS_CONTAINER",
"STORAGE_ACCOUNT_PROCESS_QUEUE",
]
for var in env_vars:
value = os.environ.get(var)
if value:
print(f"✅ {var}={value}")
else:
print(f"❌ {var} not set")
if __name__ == "__main__":
test_configuration()