*** Settings ***
Library           RequestsLibrary
Resource          flow_zmx.resource
Resource          res_zmx.resource

*** Variables ***
${path}           /api/v1/mcp/page

*** Test Cases ***
正例-获取MCP服务列表成功
    [Tags]    F
    create session    URI    ${URL}
    ${content}    POST请求结果    ${path}    {"page_index":0,"page_size":20}    200    ${zh_token}
    Should Be Equal As Strings    ${content["code"]}    200
    Should Contain    ${content}    data

反例-不传入token
    [Tags]    E
    create session    URI    ${URL}
    ${content}    POST请求结果    ${path}    {"page_index":0,"page_size":20}    401    ${EMPTY}
    Should Be Equal As Strings    ${content["code"]}    401

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

反例-不传入page_index参数
    [Tags]    E
    create session    URI    ${URL}
    ${content}    POST请求结果    ${path}    {"page_size":20}    200    ${zh_token}
    Should Be Equal As Strings    ${content["code"]}    200
    Should Contain    ${content}    data

反例-不传入page_size参数
    [Tags]    E
    create session    URI    ${URL}
    ${content}    POST请求结果    ${path}    {"page_index":0}    200    ${token}
    Should Be Equal As Strings    ${content["code"]}    200
    Should Contain    ${content}    data

反例-传入非法的page_index格式
    [Tags]    E
    create session    URI    ${URL}
    ${content}    POST请求结果    ${path}    {"page_index":"abc","page_size":20}    422    ${zh_token}
    Should Contain    ${content}    detail
