add tests (在测试模块,增加 emv界面测试 和 计量界面测试)

This commit is contained in:
2025-08-29 14:55:00 +08:00
parent 7cb36c75ea
commit 17abd13df7
8 changed files with 407 additions and 0 deletions

17
tests/common.py Normal file
View File

@ -0,0 +1,17 @@
import sys
import os
# 注意: 只在 tests 目录下的 测试文件中使用
# 设置项目目录 为搜索目录
# 通用逻辑:添加项目根目录到搜索路径
def add_project_root_to_path():
# 获取项目根目录tests的上级目录
project_root = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
if project_root not in sys.path:
sys.path.append(project_root)
# 自动执行(导入时就添加路径)
add_project_root_to_path()