-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_core.py
More file actions
67 lines (54 loc) · 2.19 KB
/
test_core.py
File metadata and controls
67 lines (54 loc) · 2.19 KB
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
import sys
import os
# ================= Setup Start =================
# Add install dir to sys.path
install_dir = os.path.join(os.getcwd(), "out", "install", "x64-msvc-Release")
sys.path.append(install_dir)
# ================= Setup End =================
from PySide6.QtCore import QCoreApplication, QTimer
import PyQWindowKit
def test_core_features():
print("-" * 20)
print("Testing Core Features...")
# 1. Test Core Module Import
try:
from PyQWindowKit import Core
print("[PASS] Core module imported.")
except ImportError as e:
print(f"[FAIL] Core module import failed: {e}")
return
# 2. Test StyleAgent and SystemTheme
if hasattr(Core, "StyleAgent"):
print("[PASS] StyleAgent found in Core.")
if hasattr(Core.StyleAgent, "SystemTheme"):
print("[PASS] StyleAgent.SystemTheme found.")
try:
# Access an enum value to verify
print(f" SystemTheme.Dark = {Core.StyleAgent.SystemTheme.Dark}")
except AttributeError:
print(" [WARN] SystemTheme.Dark not found (check enum values).")
else:
print("[FAIL] StyleAgent.SystemTheme NOT found.")
else:
print("[FAIL] StyleAgent NOT found in Core.")
# 3. Test WindowAgentBase and SystemButton
if hasattr(Core, "WindowAgentBase"):
print("[PASS] WindowAgentBase found in Core.")
if hasattr(Core.WindowAgentBase, "SystemButton"):
print("[PASS] WindowAgentBase.SystemButton found.")
try:
print(f" SystemButton.Close = {Core.WindowAgentBase.SystemButton.Close}")
except AttributeError:
print(" [WARN] SystemButton.Close not found.")
else:
print("[FAIL] WindowAgentBase.SystemButton NOT found.")
else:
print("[FAIL] WindowAgentBase NOT found in Core.")
print("-" * 20)
if __name__ == "__main__":
app = QCoreApplication(sys.argv)
print(f"PyQWindowKit Package File: {PyQWindowKit.__file__}")
test_core_features()
print("PyQWindowKit Core Test - Finished")
QTimer.singleShot(0, app.quit)
sys.exit(app.exec())