This commit is contained in:
Sandro Eiler 2023-07-01 20:34:21 +02:00
commit fd8c97600a
8 changed files with 1712 additions and 0 deletions

23
tests/quick_dev.rs Normal file
View file

@ -0,0 +1,23 @@
#![allow(unused_imports)]
use anyhow::Result;
use serde_json::json;
#[tokio::test]
async fn test_quick_dev() -> Result<()> {
let hc = httpc_test::new_client("http://localhost:3000")?;
hc.do_get("/hello?name=jen").await?.print().await?;
let hc = httpc_test::new_client("http://localhost:3000")?;
hc.do_get("/hello2/mike").await?.print().await?;
hc.do_get("/src/main.rs").await?.print().await?;
hc.do_get("/src/blub.rs").await?.print().await?;
let req_login = hc.do_post("/api/login", json!({"username": "demo1", "password": "demo1"}));
req_login.await?.print().await?;
Ok(())
}