摘要:
# 测试整个流程import unittestfrom common.get_request import GetRequestfrom common.read_data import ReadDatafrom ddt import ddt, datafrom common import const 阅读全文
posted @ 2020-04-06 21:35
测试媛S
阅读(259)
评论(0)
推荐(0)
摘要:
class Context: borrow_user = 1851xxxxx2 borrow_pwd = 123456 borrow_id = 89xx09 admin_user = 177xxxxx40 admin_pwd = 123456 admin_id = 29x627 normal_use 阅读全文
posted @ 2020-04-06 21:06
测试媛S
阅读(163)
评论(0)
推荐(0)
摘要:
解决方案: def replace_new(s): # 读取出来的数据用context的数据去替换,loan_id 动态替换 p = '\$\{(.*?)}' while re.search(p, s): m = re.search(p, s) key = m.group(1) if hasattr 阅读全文
posted @ 2020-04-06 21:04
测试媛S
阅读(3918)
评论(0)
推荐(0)
摘要:
# 反射 动态新增/修改删除动态属性或方法class Girl: name = 'sophia' age = 18g = Girl()# setattr 设置属性setattr(Girl, 'hub', 'swimming') #增加类属性print(Girl.hub) # 类可以调用新增的类属性p 阅读全文
posted @ 2020-04-06 17:56
测试媛S
阅读(132)
评论(0)
推荐(0)
摘要:
import re def replace(s, d): p = '\$\{(.*?)}' for v in d.values(): print('v:', v) s = re.sub(p, v, s, count=1) # 函数以列表返回字典中的所有值 print('替换后的s:', s)s = 阅读全文
posted @ 2020-04-06 17:18
测试媛S
阅读(168)
评论(0)
推荐(0)
摘要:
# 正则 正则式针对字符串的操作import res = '{"mobilephone": "${borrow_user}", "pwd": "${borrow_pwd}"}'d = {"mobilephone": "18511295864", "pwd": "123456"}p = '\$\{(. 阅读全文
posted @ 2020-04-06 16:34
测试媛S
阅读(191)
评论(0)
推荐(0)
摘要:
阅读全文
posted @ 2020-04-06 14:28
测试媛S
阅读(320)
评论(0)
推荐(0)
摘要:
解决方案: 将HTMLTestRunner脚本的第631行的 print >> sys.stderr, '\nTime Elapsed: %s' % (self.stopTime-self.startTime) 或print(sys.stderr, '\nTime Elapsed: %s' % (s 阅读全文
posted @ 2020-04-06 14:21
测试媛S
阅读(4289)
评论(1)
推荐(2)