Grillon – API-Test-Framework
Elegante, intuitive und ausdrucksstarke API
Integrierte Testfunktionen
Support-Erweiterung
Verwendung:
use grillon::{dsl::*, dsl::http::*, json, Grillon, StatusCode, Result};
use grillon::header::{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(())
}
Weiterlesen:https://github.com/owlduty/grillon
qcd – Verzeichnisse schnell wechseln
qcd ist ein Linux-Tool, das zur Verbesserung der Befehlszeileneffizienz beiträgt.
Verzeichnis wechseln
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
Eintrag hinzufügen oder entfernen
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
Weiterlesen:https://github.com/ClaasBontus/qcd_rs
Vom täglichen Gruppenmook
Abonnement der Community-Learning-Exchange-Plattform:
Rustcc-Forum: RSS unterstützen
Öffentliches WeChat-Konto: Chinesische Community in Rust-Sprache