robot grpc support
Project description
环境要求
- python >= 2.7
- pip
- node >= 10,设置环境变量保证
node -v
正常输出
安装
npm config set registry https://registry.npm.taobao.org && npm config set @yunke:registry https://registry-npm.myscrm.cn/repository/yunke/
npm i -g robot-grpc
pip install RobotGrpc
- 如果使用Windows系统的RIDE,需要重启机器
使用示例
robot脚本文件
*** Settings ***
Library RobotGrpc api.myscrm.cn:30051 https://git.myscrm.cn/jiangj01/panther-proto.git f-20180508-project b1wZx77sDx1YQPLyLww3
*** Test Cases ***
调用grpc方法
${res} = invoke grpc method article_project.ProjectArticleService.GetArticleInfo { "sid": "12323553" }
log ${res}
执行所有用例
run grpc cases ${CURDIR}/GetArticleInfo.js
指定运行特定用例
run grpc cases ${CURDIR}/GetArticleInfo.js 异常
运行场景用例
run grpc cases ${CURDIR}/login.js
GetArticleInfo.js
const id = "article_project.ProjectArticleService.GetArticleInfo";
module.exports = {
id: id,
cases: {
正常: {
id: id,
name: "正常",
desc: 'desc',
request: {
"article_id": 0,
"yk_org_code": "string",
"project_id": 0
},
response: {
"article_id": 0,
"yk_org_code": "string",
"user_id": 0,
"title": "string", // 标题
"thumbnail": "string",
"publish_time": 0,
"record_info": {
"read_num": 0,
"read_person_num": 0,
"forwarded_num": 0,
"forwarded_person_num": 0,
"like_num": 0,
"like_list": [{}]
},
"project_id": 0,
"post_content": "string",
"status": 0
}
},
异常: {
id: id,
name: "异常",
desc: '',
request: {
"article_id": 0,
"yk_org_code": "string",
"project_id": 0
},
response: {
"article_id": 1,
"yk_org_code": "string",
"user_id": 0,
"title": "string", // 标题
"thumbnail": "string",
"publish_time": 0,
"record_info": {
"read_num": 0,
"read_person_num": 0,
"forwarded_num": 0,
"forwarded_person_num": 0,
"like_num": 0,
"like_list": [
{
}
]
},
"project_id": 0,
"post_content": "string",
"status": 0
}
}
}
}
login.js
const GetArticleInfo = require('./GetArticleInfo');
module.exports = {
id: 'login',
cases: [
GetArticleInfo.cases.正常,
GetArticleInfo.cases.异常,
],
}
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
RobotGrpc-0.0.9.tar.gz
(3.0 kB
view hashes)
Built Distribution
Close
Hashes for RobotGrpc-0.0.9-py2-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | eab6ca37527ecb6f9ec63f8c403d4beaec628ceb9ba0f0515fa1caa52f340d31 |
|
MD5 | 28bbe1c22e659ecaa0f67c59235ff025 |
|
BLAKE2b-256 | 4bb9f72bf5f52ec4834d0bd1ab51d96098654df9858d4f8000a0e6f08a84f832 |