Skip to content

Commit 754caf3

Browse files
authored
Add unit tests for module imports
1 parent 7110d58 commit 754caf3

1 file changed

Lines changed: 28 additions & 0 deletions

File tree

tests/test_imports.py

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import unittest
2+
import sys
3+
import os
4+
5+
# Add parent directory to path so we can import modules
6+
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
7+
8+
class TestImports(unittest.TestCase):
9+
def test_docker_manager_import(self):
10+
try:
11+
from docker_manager import DockerManager
12+
except ImportError as e:
13+
self.fail(f"Failed to import DockerManager: {e}")
14+
15+
def test_ui_modals_import(self):
16+
try:
17+
from ui.modals import CreateContainerModal
18+
except ImportError as e:
19+
self.fail(f"Failed to import modals: {e}")
20+
21+
def test_main_import(self):
22+
try:
23+
import main
24+
except ImportError as e:
25+
self.fail(f"Failed to import main: {e}")
26+
27+
if __name__ == '__main__':
28+
unittest.main()

0 commit comments

Comments
 (0)