4 个版本
0.1.3 | 2021 年 2 月 3 日 |
---|---|
0.1.2 | 2020 年 11 月 28 日 |
0.1.1 | 2020 年 10 月 18 日 |
0.1.0 | 2020 年 10 月 18 日 |
#13 in #surf
3,107 每月下载量
在 少于 9 crates 中使用
7KB
tide-testing
在 surf 和 tide 之间提供一个方便的桥梁,用于生成测试用的合成请求
安装
$ cargo add -D tide-testing
示例用法
let mut app = tide::new();
app.at("/").get(|_| async { Ok("hello!") });
use tide_testing::TideTestingExt;
assert_eq!(app.get("/").recv_string().await?, "hello!");
assert_eq!(
app.post("/missing").await?.status(),
tide::http::StatusCode::NotFound
);
Cargo 功能
安全性
此 crate 使用 #![deny(unsafe_code)]
确保所有内容都在 100% 安全的 Rust 中实现。
许可协议
许可协议为 Apache License, Version 2.0 或 MIT 许可证,任选其一。除非您明确表示,否则您提交给此 crate 的任何贡献,根据 Apache-2.0 许可证定义,将按上述方式双许可,不附加任何额外条款或条件。
依赖项
~10–25MB
~347K SLoC