自动化目前需求问题
需求功能
1. 只需在common中新增yaml文件,自动生成相对于的配置代码
分析
1. common中新增唯一命名的yaml文件
2. setting.py中配置路径
1 config_path = os.path.join(root_path, 'common' + _SLASH + 'config.yaml')
3. regularControl.py中替换路径ConfigHandler.config_path
1 @property 2 def requestHead_getBalance(self): 3 4 from utils.readFilesUtils.yamlControl import GetYamlData 5 from common.setting import ConfigHandler 6 7 # 从配置文件conf.yaml 文件中获取headers,然后使用正则替换给data_yaml 8 requestHead_getBalance = GetYamlData(ConfigHandler.config_path) \ 9 .get_yaml_data()['requestHead_getBalance'] 10 return requestHead_getBalance
目标
编写一个方法,当新增yaml文件时,执行该方法,自动在对应文件里配置响应的代码