summaryrefslogtreecommitdiff
path: root/test_refactored.py
diff options
context:
space:
mode:
authorxXJSONDeruloXx <danielhimebauch@gmail.com>2025-07-13 13:24:30 -0400
committerxXJSONDeruloXx <danielhimebauch@gmail.com>2025-07-13 13:24:30 -0400
commit83a528be3a23bd43beb6a002c023a3673cad03ae (patch)
tree48864efe2d74271e2e3688cb31ecf7742f1a8844 /test_refactored.py
parent7866a9a77d2a0922883637576f6cdac122c56d42 (diff)
downloaddecky-lsfg-vk-83a528be3a23bd43beb6a002c023a3673cad03ae.tar.gz
decky-lsfg-vk-83a528be3a23bd43beb6a002c023a3673cad03ae.zip
update readme w manual install instructions
Diffstat (limited to 'test_refactored.py')
-rw-r--r--test_refactored.py79
1 files changed, 79 insertions, 0 deletions
diff --git a/test_refactored.py b/test_refactored.py
new file mode 100644
index 0000000..a25d9ef
--- /dev/null
+++ b/test_refactored.py
@@ -0,0 +1,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)