forked from bootlin/snagboot
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtests.py
More file actions
35 lines (24 loc) · 980 Bytes
/
Copy pathtests.py
File metadata and controls
35 lines (24 loc) · 980 Bytes
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
from snagfactory.config import read_config
from snagfactory.gui import SnagFactory
from snagfactory.session import SnagFactorySession
from snagrecover.usb import SnagbootUSBContext
from kivy.lang import Builder
print("Testing config file reader")
config_files = ["docs/snagfactory-emmc.yaml", "docs/snagfactory-mtd.yaml"]
for config_file in config_files:
read_config(config_file, check_paths=False)
print("Testing Kivy application builder")
app = SnagFactory()
Builder.load_file("src/snagfactory/gui.kv")
Builder.load_file("src/snagfactory/config.kv")
print("Testing Snagfactory session init")
session = SnagFactorySession(None)
print("Testing Snagboot USB context initialization")
try:
SnagbootUSBContext.rescan()
print("Testing Snagboot USB context hard rescan")
SnagbootUSBContext.hard_rescan()
except Exception as e:
# Skip USB tests if no backend is available (e.g., in Windows CI env)
print(f"Skipping USB tests: {e}")
print("All tests ran without errors")