Add filename & content type to comparison
This commit is contained in:
parent
bb0a19ca64
commit
5bb45e9e82
19
src/lib.rs
19
src/lib.rs
|
@ -364,17 +364,26 @@ mod tests {
|
|||
let path1 = "./files/Shenzi.webp";
|
||||
let path2 = "./files/Shenzi.png";
|
||||
form.add_text("meowdy", "y'all");
|
||||
form.add_reader("images[]", std::fs::File::open(path1).expect("Opened file"));
|
||||
form.add_reader_file_with_mime(
|
||||
"images[]",
|
||||
std::fs::File::open(path1).expect("Opened file"),
|
||||
"Shenzi.webp",
|
||||
"image/webp".parse().expect("Valid mime"),
|
||||
);
|
||||
form.add_reader("images[]", std::fs::File::open(path2).expect("Opened file"));
|
||||
form.add_text("howdy", "y'all");
|
||||
|
||||
let body = super::Body::builder()
|
||||
.boundary("MYBOUNDARY")
|
||||
.append(super::Part::new_str("meowdy", "y'all"))
|
||||
.append(super::Part::new(
|
||||
"images[]",
|
||||
tokio::fs::File::open(path1).await.expect("Opened file"),
|
||||
))
|
||||
.append(
|
||||
super::Part::new(
|
||||
"images[]",
|
||||
tokio::fs::File::open(path1).await.expect("Opened file"),
|
||||
)
|
||||
.filename("Shenzi.webp")
|
||||
.content_type("image/webp".parse().expect("Valid mime")),
|
||||
)
|
||||
.append(super::Part::new(
|
||||
"images[]",
|
||||
tokio::fs::File::open(path2).await.expect("Opened file"),
|
||||
|
|
Loading…
Reference in a new issue