Spaces:
Running
Running
#!/usr/bin/env python3 | |
""" | |
Test to verify that monitoring functionality is unchanged | |
""" | |
import trackio | |
import os | |
print("Testing that monitoring functionality is unchanged...") | |
# Test 1: Verify config still works with attributes | |
config = trackio.config | |
print(f"β Attribute access: project_name = {config.project_name}") | |
# Test 2: Verify new dictionary access works | |
config['test_key'] = 'test_value' | |
print(f"β Dictionary access: test_key = {config['test_key']}") | |
# Test 3: Verify both access methods work for same data | |
config.project_name = 'new_project' | |
print(f"β Attribute set: project_name = {config.project_name}") | |
print(f"β Dictionary get: project_name = {config['project_name']}") | |
# Test 4: Verify update method still works | |
config.update({'another_key': 'another_value'}) | |
print(f"β Update method: another_key = {config.another_key}") | |
# Test 5: Verify monitoring functions are unchanged | |
print(f"β Init function exists: {hasattr(trackio, 'init')}") | |
print(f"β Log function exists: {hasattr(trackio, 'log')}") | |
print(f"β Finish function exists: {hasattr(trackio, 'finish')}") | |
# Test 6: Verify config has all expected methods | |
print(f"β Config has update: {hasattr(config, 'update')}") | |
print(f"β Config has __getitem__: {hasattr(config, '__getitem__')}") | |
print(f"β Config has __setitem__: {hasattr(config, '__setitem__')}") | |
print("\nπ All monitoring functionality is preserved!") | |
print("π The fix only enhances the interface layer without affecting core monitoring.") |