Files
rdp_client/test_method_fix.py
root 8de2e372a7 Fix missing _get_best_monitor_selection method
Error: 'RDPClient' object has no attribute '_get_best_monitor_selection'

Root cause: Method was accidentally removed during previous code refactoring
when adding _get_monitors_combined_resolution method.

Fix:
- Restored complete _get_best_monitor_selection method with all functionality
- Cleaned up duplicate/corrupted code fragments
- Removed duplicate _setup_gui method definitions
- Added test script to verify method accessibility

Verified:
- _get_best_monitor_selection(2) returns '1,2' 
- _get_monitors_combined_resolution('1,2') returns '3840x1080' 
- Both methods properly integrated in RDPClient class 

The '2 Monitors' selection should now work without AttributeError.
2025-09-18 11:07:51 +02:00

40 lines
1.1 KiB
Python

#!/usr/bin/env python3
import sys
import os
sys.path.append('/home/rwiegand/skripte')
# Test if the method is properly accessible
def test_method():
try:
from rdp_client import RDPClient
import logging
logging.basicConfig(level=logging.INFO)
# Create a test instance
client = RDPClient()
print('Testing _get_best_monitor_selection method...')
# Test the method
result = client._get_best_monitor_selection(2)
print(f'✅ Method works! Result: {result}')
# Test combined resolution method too
combined_res = client._get_monitors_combined_resolution(result)
print(f'✅ Combined resolution method works! Result: {combined_res}')
return True
except Exception as e:
print(f'❌ Error: {e}')
import traceback
traceback.print_exc()
return False
if __name__ == "__main__":
print("=== Testing RDPClient Methods ===")
success = test_method()
if success:
print("✅ All methods working correctly!")
else:
print("❌ There are still issues to fix.")