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

*** Variables ***
${path}           /api/chat/gen-title

*** Test Cases ***
正例-正常获取到会话title
    [Tags]    F
    create session    URI    ${URL}
    ${content}    POST请求结果    ${path}    {"sessionId":"${sessionId}","content":"你好"}    200    ${token}
    log    ${content}
    Should Be Equal As Strings    ${content["code"]}    200

反例-传入无效的token
    [Tags]    F
    create session    URI    ${URL}
    ${content}    POST请求结果    ${path}    {"sessionId":"${sessionId}","content":"你好"}    401    {}
    log    ${content}
    Should Be Equal As Strings    ${content["code"]}    401

反例-不传入sessionId
    [Tags]    E
    create session    URI    ${URL}
    ${content}    POST请求结果    ${path}    {"content":"你好"}    200    ${token}
    log    ${content}
    Should Be Equal As Strings    ${content["code"]}    200

反例-不传入content
    [Tags]    E
    create session    URI    ${URL}
    ${content}    POST请求结果    ${path}    {"sessionId":"${sessionId}"}    200    ${token}
    log    ${content}
    Should Be Equal As Strings    ${content["code"]}    200

反例-传入空白token
    [Tags]    E
    create session    URI    ${URL}
    ${content}    POST请求结果    ${path}    {"sessionId":"${sessionId}","content":"你好"}    401    ${EMPTY}
    log    ${content}
    Should Be Equal As Strings    ${content["code"]}    401
