aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--src/ipm/utils/freeze.py2
-rw-r--r--tests/test_api.py17
2 files changed, 12 insertions, 7 deletions
diff --git a/src/ipm/utils/freeze.py b/src/ipm/utils/freeze.py
index ef02473..5c6951c 100644
--- a/src/ipm/utils/freeze.py
+++ b/src/ipm/utils/freeze.py
@@ -53,7 +53,7 @@ def extract_ipk(
hash_path = ifp_path.parent / (ifp_path.name + ".hash")
if not hash_path.exists():
- raise VerifyFailed("哈希文件不存在!")
+ raise VerifyFailed(f"哈希文件[{hash_path}]不存在!")
if not ifp_verify(ifp_path, hash_path.read_bytes()):
raise VerifyFailed("文件完整性验证失败!")
diff --git a/tests/test_api.py b/tests/test_api.py
index e45bb77..7136b36 100644
--- a/tests/test_api.py
+++ b/tests/test_api.py
@@ -1,15 +1,20 @@
-from ipm.api import build, extract, install
+from ipm import api
+
+
+def test_new():
+ api.new("test")
def test_build():
- build("C:\\Users\\fu050\\Desktop\\coc")
+ api.new("test")
+ api.build("test")
def test_extract():
- build("C:\\Users\\fu050\\Desktop\\coc")
- extract("C:\\Users\\fu050\\Desktop\\coc\\dist\\coc-0.1.0-alpha.1.ipk")
+ api.build("test")
+ api.extract("test\\dist\\test-0.1.0.ipk")
def test_install():
- build("C:\\Users\\fu050\\Desktop\\coc")
- install("C:\\Users\\fu050\\Desktop\\coc\\dist\\coc-0.1.0-alpha.1.ipk")
+ api.build("test")
+ api.install("test\\dist\\test-0.1.0.ipk")