Exemplo n.º 1
0
def enum_type():
    form = EnumTypeForm().validate_for_api()
    if form.type.data == 'METHOD':
        return CaseMethodEnum.data()
    elif form.type.data == 'SUBMIT':
        return CaseSubmitEnum.data()
    elif form.type.data == 'DEAL':
        return CaseDealEnum.data()
    elif form.type.data == 'TYPE':
        return CaseTypeEnum.data()
    elif form.type.data == 'ASSERT':
        return CaseAssertEnum.data()
    else:
        return {
            'METHOD': CaseMethodEnum.data(),
            'SUBMIT': CaseSubmitEnum.data(),
            'DEAL': CaseDealEnum.data(),
            'TYPE': CaseTypeEnum.data(),
            'ASSERT': CaseAssertEnum.data(),
        }
Exemplo n.º 2
0
        'assertion': case.assertion,
        'condition': case.condition,
        'create_time': task.create_time,
        # celery 中获取不到当前用户  只能从dealy传入
        'create_user': user.id,
        'username': user.username,
        'data': case.data,
        'deal_text': CaseDealEnum.data()[case.deal],
        'deal': case.deal,
        'expect': case.expect,
        'header': case.header,
        'info': case.info,
        'method_text': CaseMethodEnum.data()[case.method],
        'method': case.method,
        'reason': case.reason,
        'submit_text': CaseSubmitEnum.data()[case.submit],
        'submit': case.submit,
        'type': CaseTypeEnum.data()[case.type],
        'url': case.url,
        'result': case.result,
        'project_id': project.id,
        'project_name': project.name,
        'project_type': project.type,
        'project_type_name': ProjectTypeEnum.data()[project.type],
        'task_id': task.id,
        'task_no': task.task_no,
        'deal_result': case.deal_result
    }
    return case_log