-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUnitTest.py
More file actions
51 lines (41 loc) · 1.26 KB
/
UnitTest.py
File metadata and controls
51 lines (41 loc) · 1.26 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
from ModHandler import ModHandler
from BepinexUpdater import BepinexUpdater
from LCMMConfig import Config
# Unit Test
config = Config()
for key, pair in config.config.items():
print(f"[INFO] {key}: {pair}")
# Unit Test
test_package="./test_env/Test.zip"
tast_name="R2API"
config={
"game_directory": "./test_env/",
"bepinex_directory": "./test_env/BepInEx",
"plugins_directory": "./test_env/BepInEx/plugins",
"lmdata_directory": "./test_env/BepInEx/lmdata"
}
modhandler = ModHandler("config")
modhandler.install(test_package)
x,y = modhandler.get_needed_dependencies(tast_name)
if x:
print(f"[INFO] Dependencies Needed for {tast_name}.")
if y:
print(f"[INFO] Dependencies for {tast_name} are Disbaled.")
modhandler.disable(tast_name)
modhandler.disable(tast_name)
modhandler.enable(tast_name)
modhandler.enable(tast_name)
modhandler.uninstall(tast_name)
modhandler.uninstall(tast_name)
# Unit test
config={
"game_directory": "./test_env/",
"bepinex_directory": "./test_env/BepInEx",
"plugins_directory": "./test_env/BepInEx/plugins",
"lmdata_directory": "./test_env/BepInEx/lmdata"
}
test = BepinexUpdater(config)
print("[INFO] Start Failure tests")
test.getLatestURL(None)
test.downloadFile(None, None)
test.install(None, None)