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

*** Variables ***
${path}           /api/v1/mcp/test/srv-conn

*** Test Cases ***
测试已保存的MCP服务成功
    create session    URI    ${URL}
    ${content}    GET请求结果    ${path}/${mcp_id}    {}    200    ${zh_token}
    Should Be Equal As Strings    ${content["code"]}    200
    Should Contain    ${content["data"]}    state
    Should Be Equal As Strings    ${content["data"]["state"]}    active
    Should Contain    ${content["data"]}    tools
    Should Contain    ${content["data"]}    tools_count
    Should Be Equal As Strings    ${content["data"]["tools_count"]}    4

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

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

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

传入非法格式的MCP服务ID
    create session    URI    ${URL}
    ${content}    GET请求结果    ${path}/abc    {}    422    ${zh_token}
    Should Contain    ${content}    detail
