53 lines
1.3 KiB
Python
53 lines
1.3 KiB
Python
|
#!/usr/bin/env python
|
||
|
# -*- coding: utf-8 -*-
|
||
|
|
||
|
import os
|
||
|
import platform
|
||
|
|
||
|
class ConfigHandler:
|
||
|
root_path = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
||
|
|
||
|
# 测试数据路径
|
||
|
data_path = os.path.join(root_path, 'data' )
|
||
|
merchant_data_path = os.path.join(root_path, 'data')
|
||
|
|
||
|
cache_path = os.path.join(root_path, 'cache' )
|
||
|
|
||
|
if not os.path.exists(cache_path):
|
||
|
os.mkdir(cache_path)
|
||
|
|
||
|
case_path = os.path.join(root_path, 'test_case' )
|
||
|
|
||
|
file_path = os.path.join(root_path, 'files' )
|
||
|
|
||
|
|
||
|
# 测试报告路径
|
||
|
report_path = os.path.join(root_path, 'report')
|
||
|
|
||
|
log_path = os.path.join(root_path , 'logs')
|
||
|
|
||
|
info_log_path = os.path.join(root_path, 'logs' ,'info.log')
|
||
|
|
||
|
error_log_path = os.path.join(root_path, 'logs' , 'error.log')
|
||
|
|
||
|
warning_log_path = os.path.join(root_path, 'logs' ,'warning.log')
|
||
|
|
||
|
if not os.path.exists(report_path):
|
||
|
os.mkdir(report_path)
|
||
|
|
||
|
config_path = os.path.join(root_path, 'config' , 'conf.yaml')
|
||
|
|
||
|
excel_path = os.path.join(root_path, 'data' )
|
||
|
|
||
|
# lib 存放po文件
|
||
|
lib_path = os.path.join(root_path, "lib" )
|
||
|
|
||
|
temp_path = os.path.join(root_path, 'report' , 'tmp')
|
||
|
if not os.path.exists(temp_path):
|
||
|
os.mkdir(temp_path)
|
||
|
|
||
|
html_path = os.path.join(root_path, 'report' ,'html')
|
||
|
|
||
|
|
||
|
if __name__ == '__main__':
|
||
|
print(ConfigHandler.data_path)
|