swadhin biswas redy to jump in work Β· 7/25/2025
d8c49a5
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
#!/usr/bin/env python3
"""
Test script for LaxyFile - Verify basic functionality
"""
import sys
import os
from pathlib import Path
# Add current directory to path
sys.path.insert(0, str(Path(__file__).parent))
def test_imports():
"""Test that all modules can be imported"""
print("π§ͺ Testing imports...")
try:
from laxyfile.core.config import Config
print("β
Config module imported successfully")
from laxyfile.core.file_manager import FileManager, FileInfo
print("β
FileManager module imported successfully")
from laxyfile.ui.theme import ThemeManager
print("β
ThemeManager module imported successfully")
from laxyfile.ui.panels import PanelManager
print("β
PanelManager module imported successfully")
from laxyfile.ui.image_viewer import ImageViewer
print("β
ImageViewer module imported successfully")
from laxyfile.ai.assistant import AIAssistant
print("β
AIAssistant module imported successfully")
from laxyfile.utils.logger import Logger
print("β
Logger module imported successfully")
return True
except Exception as e:
print(f"β Import failed: {e}")
return False
def test_basic_functionality():
"""Test basic functionality"""
print("\nπ§ Testing basic functionality...")
try:
# Test config
from laxyfile.core.config import Config
config = Config()
print(f"β
Config loaded, theme: {config.get_theme().name}")
# Test file manager
from laxyfile.core.file_manager import FileManager
fm = FileManager()
files = fm.list_directory(Path.cwd())
print(f"β
FileManager working, found {len(files)} items in current directory")
# Test theme manager
from laxyfile.ui.theme import ThemeManager
theme_manager = ThemeManager(config)
themes = theme_manager.get_available_themes()
print(f"β
ThemeManager working, available themes: {', '.join(themes)}")
# Test logger
from laxyfile.utils.logger import Logger
logger = Logger()
logger.info("Test log message")
print("β
Logger working")
return True
except Exception as e:
print(f"β Functionality test failed: {e}")
return False
def test_rich_ui():
"""Test Rich UI components"""
print("\nπ¨ Testing Rich UI...")
try:
from rich.console import Console
from rich.panel import Panel
from rich.text import Text
console = Console()
# Test basic Rich functionality
test_panel = Panel(
Text("LaxyFile Test", style="bold green"),
title="π Test Panel",
border_style="blue"
)
console.print(test_panel)
print("β
Rich UI components working")
return True
except Exception as e:
print(f"β Rich UI test failed: {e}")
return False
def main():
"""Main test function"""
print("π LaxyFile Test Suite")
print("=" * 50)
# Run tests
import_success = test_imports()
func_success = test_basic_functionality()
ui_success = test_rich_ui()
print("\n" + "=" * 50)
print("π Test Results:")
print(f" Imports: {'β
PASS' if import_success else 'β FAIL'}")
print(f" Functionality: {'β
PASS' if func_success else 'β FAIL'}")
print(f" Rich UI: {'β
PASS' if ui_success else 'β FAIL'}")
if all([import_success, func_success, ui_success]):
print("\nπ All tests passed! LaxyFile is ready to run.")
print(" Run: python main.py")
else:
print("\nβ οΈ Some tests failed. Please check the installation.")
print(" Try: pip install -r requirements.txt")
if __name__ == "__main__":
main()