-
I tried to look at tests at actix-multipart but it doesn't exists. I would like to test actix-multipart which accepts multipart/form-data. my current code is #[actix_web::test]
async fn api_avif_test() {
let app = test::init_service(App::new().service(scope())).await;
let req = test::TestRequest::post()
.uri("/aa/encode/")
.insert_header(ContentType(mime::MULTIPART_FORM_DATA))
// .set_payload("")
.to_request();
let resp = test::call_service(&app, req).await;
let body = to_bytes(resp.into_body()).await.unwrap();
let body = std::str::from_utf8(&body).unwrap();
let parsed_resp: WatermarkResponse = serde_json::from_str(body).unwrap();
assert_eq!(parsed_resp.code, 200);
} But I have no idea how to set payload for this request. |
Beta Was this translation helpful? Give feedback.
Answered by
robjtede
Feb 13, 2024
Replies: 1 comment 1 reply
-
Made some time today to start on this work. You can follow progress on #2808. |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
robjtede
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Made some time today to start on this work. You can follow progress on #2808.