Project

General

Profile

grading_rules #6587

Updated by UserName LastName over 1 year ago

# 不为空 
 - expr_type: python 
   expr: '[log "[log for log in records if log is not None]' 
   expr_type: python 
   None]" 
   weight: 20 
 
 # 使用了requests 
 - expr_type: python 
   expr: '[log "[log for log in records if log.module_name in [''requests.models'',''urllib3'',''urllib'']]' 
   expr_type: python 
   ['requests.models','urllib3','urllib']]" 
   weight: 10 
 
 # 是否使用po 
 - expr_type: python 
   expr: '[log "[log for log in records if log.depth >=4]' 
   expr_type: python 
   >=4]" 
   weight: 10 
 
 # 是否有断言 
 - expr_type: python 
   expr: '[log "[log for log in records if log.args.get(''@py_assert1'',1) log.args.get('@py_assert1',1) is None]' 
   expr_type: python 
   None]" 
   weight: 5 
 
 # 参数不为空 
 - expr_type: python 
   expr: '[log "[log for log in records if log.args is not None]' 
   expr_type: python 
   None]" 
   weight: 5 
 
 # 使用teardown 
 - expr_type: python 
   expr: '[log "[log for log in records if log.function_name in [''teardown'',''teardown_method'',''teardown_function'',''teardown_class'',''teardown_module'']]' 
   expr_type: python 
   ['teardown','teardown_method','teardown_function','teardown_class','teardown_module']]" 
   weight: 10 
 
 # 使用setup 
 - expr_type: python 
   expr: '[log "[log for log in records if log.function_name in [''setup'',''setup_module'',''setup_function'',''setup_class'',''setup_method'']]' 
   expr_type: python 
   ['setup','setup_module','setup_function','setup_class','setup_method']]" 
   weight: 10 
 
 # 访问了 登录 
 - expr_type: python 
   expr: '[log "[log for log in records if log.args.get(''url'','''') log.args.get('url','') in ''https://thingsboard.hogwarts.ceshiren.com/api/auth/login'']' 
   expr_type: python 
   'https://thingsboard.hogwarts.ceshiren.com/api/auth/login']" 
   weight: 10 
 
 # 访问了 创建设备 
 - expr_type: python 
   expr: '[log "[log for log in records if ''https://thingsboard.hogwarts.ceshiren.com/api/device'' 
     'https://thingsboard.hogwarts.ceshiren.com/api/device' in log.args.get(''url'','''') log.args.get('url','') and log.args.get(''method'', '''') ==''post'']' 
   expr_type: python 
   log.args.get('method', '') =='post']" 
   weight: 5 
 
 # 访问了 查询设备 
 - expr_type: python 
   expr: '[log "[log for log in records if ''https://thingsboard.hogwarts.ceshiren.com/api/tenant/devices?deviceName='' 
     'https://thingsboard.hogwarts.ceshiren.com/api/tenant/devices?deviceName=' in log.args.get(''url'','''') log.args.get('url','') and log.args.get(''method'', '''') ==''get'']' 
   expr_type: python 
   log.args.get('method', '') =='get']" 
   weight: 5 
 
   # 访问了 修改设备 
 - expr_type: python 
   expr: '[log "[log for log in records if ''https://thingsboard.hogwarts.ceshiren.com/api/device'' 
     'https://thingsboard.hogwarts.ceshiren.com/api/device' in log.args.get(''url'','''') log.args.get('url','') and log.args.get(''method'', '''') ==''post'']' 
   expr_type: python 
   log.args.get('method', '') =='post']" 
   weight: 5 
 
   # 访问了 删除设备 
 - expr_type: python 
   expr: '[log "[log for log in records if ''https://thingsboard.hogwarts.ceshiren.com/api/device/'' 
     'https://thingsboard.hogwarts.ceshiren.com/api/device/' in log.args.get(''url'','''') log.args.get('url','') and log.args.get(''method'', '''') ==''delete'']' 
   expr_type: python 
   log.args.get('method', '') =='delete']" 
   weight: 5 

Back