blob: a25d9ef9faf59ea3304101c3ce38d497818c7735 (
plain)
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
69
70
71
72
73
74
75
76
77
78
79
|
#!/usr/bin/env python3
"""
Simple test script to verify the refactored plugin works.
"""
import sys
from pathlib import Path
from unittest.mock import Mock
# Add the project root to the path
project_root = Path(__file__).parent
sys.path.insert(0, str(project_root))
# Mock the decky module
mock_decky = Mock()
mock_decky.logger = Mock()
sys.modules['decky'] = mock_decky
# Now we can import our plugin
from lsfg_vk import Plugin
def test_plugin_creation():
"""Test that we can create a plugin instance"""
print("๐งช Testing plugin creation...")
plugin = Plugin()
print("โ
Plugin created successfully!")
return plugin
def test_installation_check():
"""Test the installation check method"""
print("๐งช Testing installation check...")
plugin = Plugin()
result = plugin.check_lsfg_vk_installed()
print(f"โ
Installation check result: {result}")
return result
def test_dll_detection():
"""Test the DLL detection method"""
print("๐งช Testing DLL detection...")
plugin = Plugin()
result = plugin.check_lossless_scaling_dll()
print(f"โ
DLL detection result: {result}")
return result
def test_config_operations():
"""Test configuration operations"""
print("๐งช Testing configuration operations...")
plugin = Plugin()
# This will fail since the script doesn't exist, but should return a proper error
result = plugin.get_lsfg_config()
print(f"โ
Config get result: {result}")
return result
if __name__ == "__main__":
print("๐ Starting refactored plugin tests...\n")
try:
test_plugin_creation()
print()
test_installation_check()
print()
test_dll_detection()
print()
test_config_operations()
print()
print("๐ All tests completed successfully!")
print("๐ฆ The refactored plugin structure is working correctly.")
except Exception as e:
print(f"โ Test failed with error: {e}")
import traceback
traceback.print_exc()
sys.exit(1)
|