Hopefully it works
pr CI / Test Suite (pull_request) Failing after 4m22s

This commit is contained in:
2026-08-12 15:57:42 -04:00
parent 3cd5817a14
commit 6955c781c3
+24 -11
View File
@@ -484,6 +484,7 @@ mod tests {
method: axum::http::Method,
has_body: bool,
) -> Result<axum::http::Request<axum::body::Body>, axum::http::Error> {
let mut content_type = "application/json; charset=utf-8".to_string();
let body = if has_body {
assert_eq!(
true,
@@ -491,17 +492,25 @@ mod tests {
"Has request body and payload has data"
);
// axum::body::Body::from(payload.unwrap().to_string())
match payload.unwrap() {
ReqBody::Json(val) => axum::body::Body::from(val.to_string()),
ReqBody::Multipart((t, p)) => {
let mut form = MultipartForm::default();
let _ = form.add_file(t, p);
match payload {
Some(p) => match p {
ReqBody::Json(val) => axum::body::Body::from(val.to_string()),
ReqBody::Multipart((t, p)) => {
let mut form = MultipartForm::default();
let _ = form.add_file(t, p);
// Create request
let content_type = form.content_type();
println!("Content: {content_type:?}");
let body = MultipartBody::from(form);
axum::body::Body::from_stream(body)
// Create request
// let content_type = form.content_type();
content_type = form.content_type();
println!("Content: {content_type:?}");
let body = MultipartBody::from(form);
println!("Streaming");
axum::body::Body::from_stream(body)
}
},
None => {
eprintln!("This should not empty");
axum::body::Body::empty()
}
}
} else {
@@ -512,7 +521,8 @@ mod tests {
.uri(uri)
.header(
axum::http::header::CONTENT_TYPE,
"application/json; charset=utf-8",
content_type,
// "application/json; charset=utf-8",
)
.header(
axum::http::header::AUTHORIZATION,
@@ -798,8 +808,10 @@ mod tests {
let app = init::app(pool).await;
// Send request
println!("Trying");
match request::song_queue_req(&app).await {
Ok(response) => {
println!("response: {response:?}");
let resp = util::get_resp_data::<
crate::callers::queue::song::response::song_queue::Response,
>(response)
@@ -808,6 +820,7 @@ mod tests {
assert_eq!(false, resp.data[0].is_nil(), "Should not be empty");
}
Err(err) => {
eprintln!("Failure!");
assert!(false, "Error: {:?}", err);
}
};