*** Settings ***
Resource          flow_zmx.resource
Resource          res_zmx.resource

*** Variables ***
${path}           /api/system/issue

*** Test Cases ***
正例-正常上报反馈
    [Documentation]    未区分生产环境与SIT环境，暂时注释此条用例
    [Tags]    F
    Comment    create session    URI    ${URL}
    Comment    ${file}    Evaluate    (r'testissue.zip', open(r'${CURDIR}${/}testfiles${/}testissue.zip', 'rb'))
    Comment    ${header}    Create Dictionary    Authorization=${token}
    Comment    ${files}    Create Dictionary    file=${file}
    Comment    ${resp}    Post On Session    URI    ${path}    files=${files}    headers=${header}
    Comment    ${content}    Set Variable    ${resp.json()}
    Comment    log    ${content}
    Comment    Should Be Equal As Strings    ${content["code"]}    200
    Comment    Should Be Equal As Strings    ${content["message"]}    成功

反例-不传token
    [Documentation]    未区分生产环境与SIT环境，暂时注释此条用例
    [Tags]    E
    Comment    create session    URI    ${URL}
    Comment    ${file}    Evaluate    (r'testissue.zip', open(r'${CURDIR}${/}testfiles${/}testissue.zip', 'rb'))
    Comment    ${header}    Create Dictionary    Authorization=${EMPTY}
    Comment    ${files}    Create Dictionary    file=${file}
    Comment    ${resp}    Post On Session    URI    ${path}    files=${files}    headers=${header}
    Comment    ${content}    Set Variable    ${resp.json()}
    Comment    log    ${content}
    Comment    Should Be Equal As Strings    ${content["code"]}    200
    Comment    Should Be Equal As Strings    ${content["message"]}    成功

反例-传入错误的token
    [Documentation]    未区分生产环境与SIT环境，暂时注释此条用例
    [Tags]    E
    Comment    create session    URI    ${URL}
    Comment    ${file}    Evaluate    (r'testissue.zip', open(r'${CURDIR}${/}testfiles${/}testissue.zip', 'rb'))
    Comment    ${header}    Create Dictionary    Authorization=testtoken
    Comment    ${files}    Create Dictionary    file=${file}
    Comment    ${resp}    Post On Session    URI    ${path}    files=${files}    headers=${header}
    Comment    ${content}    Set Variable    ${resp.json()}
    Comment    log    ${content}
    Comment    Should Be Equal As Strings    ${content["code"]}    200
    Comment    Should Be Equal As Strings    ${content["message"]}    成功
