You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
842 B
29 lines
842 B
#!/usr/bin/env python3
|
|
"""
|
|
只测试配置模块的导入
|
|
"""
|
|
import sys
|
|
import os
|
|
|
|
# 添加项目根目录到Python路径
|
|
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
|
|
|
|
try:
|
|
# 直接导入settings模块
|
|
from app.core.config.settings import ProtocolType, DeviceStatus
|
|
print("✅ 直接导入settings成功!")
|
|
print(f"ProtocolType.ADB: {ProtocolType.ADB}")
|
|
print(f"DeviceStatus.ONLINE: {DeviceStatus.ONLINE}")
|
|
|
|
# 测试从config模块导入
|
|
from app.core.config import ProtocolType as PT, DeviceStatus as DS
|
|
print("✅ 从config模块导入成功!")
|
|
print(f"PT.ADB: {PT.ADB}")
|
|
print(f"DS.ONLINE: {DS.ONLINE}")
|
|
|
|
except ImportError as e:
|
|
print(f"❌ 导入失败: {e}")
|
|
except Exception as e:
|
|
print(f"❌ 其他错误: {e}")
|
|
import traceback
|
|
traceback.print_exc()
|