Files
HereIAm/tests/test_config.py
Jerico Thomas 805524b78c 1.0.0 Release
2025-07-25 15:31:22 -04:00

48 lines
1.2 KiB
Python

#!/usr/bin/env python3
"""
Test script to verify the configuration system works correctly
"""
import sys
import os
sys.path.insert(0, '/Users/JeThomas/scripts/HereIAm/src')
from config_manager import ConfigManager
def test_config_manager():
print("Testing ConfigManager...")
# Create config manager
cm = ConfigManager()
# Test loading default config
config = cm.load_config()
print(f"Default config: {config}")
# Test updating config with new move_px
test_config = {
'wait_time': 300,
'start_enabled': False,
'log_level': 'DEBUG',
'move_px': 15
}
success = cm.save_config(test_config)
print(f"Save config success: {success}")
# Test loading updated config
loaded_config = cm.load_config()
print(f"Loaded config: {loaded_config}")
# Test individual value operations
cm.set_config_value('wait_time', 180)
cm.set_config_value('move_px', 20)
wait_time = cm.get_config_value('wait_time')
move_px = cm.get_config_value('move_px')
print(f"Individual wait_time: {wait_time}")
print(f"Individual move_px: {move_px}")
print("ConfigManager tests completed!")
if __name__ == "__main__":
test_config_manager()