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

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

*** Test Cases ***
正例-获取MCP服务详情成功
    [Tags]    F
    create session    URI    ${URL}
    ${content}    GET请求结果    ${path}/${mcp_id}    {}    200    ${zh_token}
    Should Be Equal As Strings    ${content["code"]}    200
    Should Contain    ${content}    data
    Should Be Equal As Strings    ${content["data"]["id"]}    ${mcp_id}
    Should Contain    ${content["data"]}    name
    Should Contain    ${content["data"]}    description
    Should Contain    ${content["data"]}    type
    Should Contain    ${content["data"]}    url
    Should Contain    ${content["data"]}    state
    Should Contain    ${content["data"]}    auth

反例-不传入token
    [Tags]    E
    create session    URI    ${URL}
    ${content}    GET请求结果    ${path}/${mcp_id}    {}    401    ${EMPTY}
    Should Be Equal As Strings    ${content["code"]}    401

反例-传入空白token
    [Tags]    E
    create session    URI    ${URL}
    ${content}    GET请求结果    ${path}/${mcp_id}    {}    401    ${EMPTY}
    Should Be Equal As Strings    ${content["code"]}    401

反例-传入不存在的MCP ID
    [Tags]    E
    create session    URI    ${URL}
    ${content}    GET请求结果    ${path}/999999    {}    200    ${zh_token}
    Should Contain    ${content["code"]}    200

反例-传入非法格式的MCP ID
    [Tags]    E
    create session    URI    ${URL}
    ${content}    GET请求结果    ${path}/abc    {}    422    ${zh_token}
    Should Contain    ${content}    detail
