Add tests

This commit is contained in:
Matt Gathu 2020-09-22 20:43:34 +02:00
parent 8ff0b43173
commit 24f845f534
No known key found for this signature in database
GPG Key ID: 7DAD4895E291CE56
1 changed files with 16 additions and 0 deletions

View File

@ -1164,4 +1164,20 @@ mod tests {
);
assert_eq!(payload.buf.len(), 0);
}
#[actix_rt::test]
async fn test_multipart_from_error() {
let err = MultipartError::NoContentType;
let mut multipart = Multipart::from_error(err);
assert!(multipart.next().await.unwrap().is_err())
}
#[actix_rt::test]
async fn test_multipart_from_boundary() {
let (_, payload) = create_stream();
let (_, headers) = create_simple_request_with_header();
let boundary = Multipart::boundary(&headers);
assert!(boundary.is_ok());
let _ = Multipart::from_boundary(boundary.unwrap(), payload);
}
}