API测试框架Grillon概述

电子说

1.2w人已加入

描述

Grillon - API 测试框架


  • 优雅、直观和富有表现力的 API
     

  • 内置测试功能
     

  • 支持扩展
     

用法:


	

use grillon::{dsl::*, dsl::*, json, Grillon, StatusCode, Result}; use grillon::{HeaderValue, CONTENT_LENGTH, CONTENT_TYPE}; #[tokio::test] async fn end_to_end_test() -> Result<()> { Grillon::new("https://jsonplaceholder.typicode.com")? .post("posts") .payload(json!({ "title": "foo", "body": "bar", "userId": 1 })) .assert() .await .status(is_success()) .status(is(201)) .response_time(is_less_than(700)) .json_body(is(json!({ "id": 101, }))) .json_body(schema(json!({ "properties": { "id": { "type": "number" } } }))) .json_path("$.id", is(json!(101))) .headers(contains(vec![ ( CONTENT_TYPE, HeaderValue::from_static("application/json; charset=utf-8"), ), (CONTENT_LENGTH, HeaderValue::from_static("15")), ])) .assert_fn(|assert| { assert!(!assert.headers.is_empty()); assert!(assert.status == StatusCode::CREATED); assert!(assert.json.is_some()); println!("Json response : {:#?}", assert.json); }); Ok(()) }

 

qcd - 快速切换目录


qcd是一个Linux工具,有助于提高命令行的效率。
 

切换目录


	

qcd ENTRY [-n] Chdir to path with idx or alias ENTRY (w/o -n: adds work dir to stack) qcd -o (pop) Chdir to top of stack, remove that entry from stack

添加或删除入口

	

qcd -a PATH [-i IDX] [-s ALIAS] Add PATH to database qcd -p [-i IDX] [-s ALIAS] Add current working directory to database qcd -r ENTRY Remove row with idx or alias ENTRY qcd -u (push) Add current working directory to (top of) stack

 

  审核编辑:汤梓红


打开APP阅读更多精彩内容
声明:本文内容及配图由入驻作者撰写或者入驻合作网站授权转载。文章观点仅代表作者本人,不代表电子发烧友网立场。文章及其配图仅供工程师学习之用,如有内容侵权或者其他违规问题,请联系本站处理。 举报投诉

全部0条评论

快来发表一下你的评论吧 !

×
20
完善资料,
赚取积分