mirror of https://github.com/http-rs/http-types
Update tests.
This commit is contained in:
parent
176deda147
commit
08bb900519
|
@ -6,7 +6,7 @@ mod tests {
|
|||
|
||||
#[async_std::test]
|
||||
async fn guess_plain_text_mime() -> io::Result<()> {
|
||||
let body = Body::from_file("tests/fixtures/index.html").await?;
|
||||
let body = Body::from_path("tests/fixtures/index.html").await?;
|
||||
let mut res = Response::new(200);
|
||||
res.set_body(body);
|
||||
assert_eq!(res.content_type(), Some(mime::HTML));
|
||||
|
@ -15,7 +15,7 @@ mod tests {
|
|||
|
||||
#[async_std::test]
|
||||
async fn guess_binary_mime() -> http_types::Result<()> {
|
||||
let body = Body::from_file("tests/fixtures/nori.png").await?;
|
||||
let body = Body::from_path("tests/fixtures/nori.png").await?;
|
||||
let mut res = Response::new(200);
|
||||
res.set_body(body);
|
||||
assert_eq!(res.content_type(), Some(mime::PNG));
|
||||
|
@ -29,7 +29,7 @@ mod tests {
|
|||
|
||||
#[async_std::test]
|
||||
async fn guess_mime_fallback() -> io::Result<()> {
|
||||
let body = Body::from_file("tests/fixtures/unknown.custom").await?;
|
||||
let body = Body::from_path("tests/fixtures/unknown.custom").await?;
|
||||
let mut res = Response::new(200);
|
||||
res.set_body(body);
|
||||
assert_eq!(res.content_type(), Some(mime::BYTE_STREAM));
|
||||
|
@ -38,7 +38,7 @@ mod tests {
|
|||
|
||||
#[async_std::test]
|
||||
async fn parse_empty_files() -> http_types::Result<()> {
|
||||
let body = Body::from_file("tests/fixtures/empty.custom").await?;
|
||||
let body = Body::from_path("tests/fixtures/empty.custom").await?;
|
||||
let mut res = Response::new(200);
|
||||
res.set_body(body);
|
||||
assert_eq!(res.content_type(), Some(mime::BYTE_STREAM));
|
||||
|
|
Loading…
Reference in New Issue