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

*** Variables ***
${path}           /api/chat/close

*** Test Cases ***
反例-传入错误的token
    [Tags]    E
    create session    URI    ${URL}
    ${content}    GET请求结果    ${path}    {"sessionId":"${sessionId}"}    401    testtoken
    log    ${content}
    Should Be Equal As Strings    ${content["code"]}    401
    Should Be Equal As Strings    ${content["message"]}    无效的access token

反例-传入空白token
    [Tags]    E
    create session    URI    ${URL}
    ${content}    GET请求结果    ${path}    {"sessionId":"${sessionId}"}    401    ${EMPTY}
    log    ${content}
    Should Be Equal As Strings    ${content["code"]}    401
    Should Be Equal As Strings    ${content["message"]}    没有找到认证信息

反例-不传sessionId参数
    [Tags]    E
    create session    URI    ${URL}
    ${content}    GET请求结果    ${path}    {}    422    ${token}
    log    ${content}
    Should Be Equal As Strings    ${content["detail"][0]["msg"]}    Field required

正例-正常结束会话
    [Tags]    F
    create session    URI    ${URL}
    ${content}    GET请求结果    ${path}    {"sessionId":"${sessionId}"}    200    ${token}
    log    ${content}
    Should Be Equal As Strings    ${content["code"]}    200
