+8
-86
@@ -1023,13 +1023,6 @@ mod tests {
|
|||||||
}
|
}
|
||||||
let songpath = song.song_path().unwrap();
|
let songpath = song.song_path().unwrap();
|
||||||
|
|
||||||
let mut form = MultipartForm::default();
|
|
||||||
let _ = form.add_file("flac", &songpath);
|
|
||||||
|
|
||||||
// Create request
|
|
||||||
let content_type = form.content_type();
|
|
||||||
let body = MultipartBody::from(form);
|
|
||||||
|
|
||||||
let raw_uri =
|
let raw_uri =
|
||||||
String::from(crate::callers::queue::endpoints::QUEUESONGUPDATE);
|
String::from(crate::callers::queue::endpoints::QUEUESONGUPDATE);
|
||||||
let end_index = raw_uri.len() - 5;
|
let end_index = raw_uri.len() - 5;
|
||||||
@@ -1043,16 +1036,7 @@ mod tests {
|
|||||||
match app
|
match app
|
||||||
.clone()
|
.clone()
|
||||||
.oneshot(
|
.oneshot(
|
||||||
axum::http::Request::builder()
|
request::run_post(Some(request::ReqBody::Multipart(("flac".to_string(), songpath))), &uri, axum::http::Method::PATCH, true).await.unwrap()
|
||||||
.method(axum::http::Method::PATCH)
|
|
||||||
.uri(uri)
|
|
||||||
.header(axum::http::header::CONTENT_TYPE, content_type)
|
|
||||||
.header(
|
|
||||||
axum::http::header::AUTHORIZATION,
|
|
||||||
bearer_auth().await,
|
|
||||||
)
|
|
||||||
.body(axum::body::Body::from_stream(body))
|
|
||||||
.unwrap(),
|
|
||||||
)
|
)
|
||||||
.await
|
.await
|
||||||
{
|
{
|
||||||
@@ -1928,19 +1912,7 @@ mod tests {
|
|||||||
match app
|
match app
|
||||||
.clone()
|
.clone()
|
||||||
.oneshot(
|
.oneshot(
|
||||||
axum::http::Request::builder()
|
request::run_post(Some(request::ReqBody::Json(payload)), crate::callers::queue::endpoints::QUEUECOVERARTDATAWIPE, axum::http::Method::PATCH, true).await.unwrap()
|
||||||
.method(axum::http::Method::PATCH)
|
|
||||||
.uri(crate::callers::queue::endpoints::QUEUECOVERARTDATAWIPE)
|
|
||||||
.header(
|
|
||||||
axum::http::header::CONTENT_TYPE,
|
|
||||||
"application/json",
|
|
||||||
)
|
|
||||||
.header(
|
|
||||||
axum::http::header::AUTHORIZATION,
|
|
||||||
bearer_auth().await,
|
|
||||||
)
|
|
||||||
.body(axum::body::Body::from(payload.to_string()))
|
|
||||||
.unwrap(),
|
|
||||||
)
|
)
|
||||||
.await
|
.await
|
||||||
{
|
{
|
||||||
@@ -2008,16 +1980,7 @@ mod tests {
|
|||||||
match app
|
match app
|
||||||
.clone()
|
.clone()
|
||||||
.oneshot(
|
.oneshot(
|
||||||
axum::http::Request::builder()
|
super::request::run_post(None, &uri, axum::http::Method::GET, false).await.unwrap()
|
||||||
.method(axum::http::Method::GET)
|
|
||||||
.uri(uri)
|
|
||||||
.header(axum::http::header::CONTENT_TYPE, "application/json")
|
|
||||||
.header(
|
|
||||||
axum::http::header::AUTHORIZATION,
|
|
||||||
super::bearer_auth().await,
|
|
||||||
)
|
|
||||||
.body(axum::body::Body::empty())
|
|
||||||
.unwrap(),
|
|
||||||
)
|
)
|
||||||
.await
|
.await
|
||||||
{
|
{
|
||||||
@@ -2065,16 +2028,7 @@ mod tests {
|
|||||||
match app
|
match app
|
||||||
.clone()
|
.clone()
|
||||||
.oneshot(
|
.oneshot(
|
||||||
axum::http::Request::builder()
|
super::request::run_post(None, &uri, axum::http::Method::GET, false).await.unwrap()
|
||||||
.method(axum::http::Method::GET)
|
|
||||||
.uri(uri)
|
|
||||||
.header(axum::http::header::CONTENT_TYPE, "application/json")
|
|
||||||
.header(
|
|
||||||
axum::http::header::AUTHORIZATION,
|
|
||||||
super::bearer_auth().await,
|
|
||||||
)
|
|
||||||
.body(axum::body::Body::empty())
|
|
||||||
.unwrap(),
|
|
||||||
)
|
)
|
||||||
.await
|
.await
|
||||||
{
|
{
|
||||||
@@ -2154,15 +2108,7 @@ mod tests {
|
|||||||
match app
|
match app
|
||||||
.clone()
|
.clone()
|
||||||
.oneshot(
|
.oneshot(
|
||||||
axum::http::Request::builder()
|
super::request::run_post(None, &uri, axum::http::Method::GET, false).await.unwrap()
|
||||||
.method(axum::http::Method::GET)
|
|
||||||
.uri(&uri)
|
|
||||||
.header(
|
|
||||||
axum::http::header::AUTHORIZATION,
|
|
||||||
super::bearer_auth().await,
|
|
||||||
)
|
|
||||||
.body(axum::body::Body::empty())
|
|
||||||
.unwrap(),
|
|
||||||
)
|
)
|
||||||
.await
|
.await
|
||||||
{
|
{
|
||||||
@@ -2214,15 +2160,7 @@ mod tests {
|
|||||||
match app
|
match app
|
||||||
.clone()
|
.clone()
|
||||||
.oneshot(
|
.oneshot(
|
||||||
axum::http::Request::builder()
|
super::request::run_post(None, &uri, axum::http::Method::GET, false).await.unwrap()
|
||||||
.method(axum::http::Method::GET)
|
|
||||||
.uri(&uri)
|
|
||||||
.header(
|
|
||||||
axum::http::header::AUTHORIZATION,
|
|
||||||
super::bearer_auth().await,
|
|
||||||
)
|
|
||||||
.body(axum::body::Body::empty())
|
|
||||||
.unwrap(),
|
|
||||||
)
|
)
|
||||||
.await
|
.await
|
||||||
{
|
{
|
||||||
@@ -2276,15 +2214,7 @@ mod tests {
|
|||||||
match app
|
match app
|
||||||
.clone()
|
.clone()
|
||||||
.oneshot(
|
.oneshot(
|
||||||
axum::http::Request::builder()
|
super::request::run_post(None, &uri, axum::http::Method::GET, false).await.unwrap()
|
||||||
.method(axum::http::Method::GET)
|
|
||||||
.uri(&uri)
|
|
||||||
.header(
|
|
||||||
axum::http::header::AUTHORIZATION,
|
|
||||||
super::bearer_auth().await,
|
|
||||||
)
|
|
||||||
.body(axum::body::Body::empty())
|
|
||||||
.unwrap(),
|
|
||||||
)
|
)
|
||||||
.await
|
.await
|
||||||
{
|
{
|
||||||
@@ -2403,15 +2333,7 @@ mod tests {
|
|||||||
match app
|
match app
|
||||||
.clone()
|
.clone()
|
||||||
.oneshot(
|
.oneshot(
|
||||||
axum::http::Request::builder()
|
super::request::run_post(None, &uri, axum::http::Method::DELETE, false).await.unwrap()
|
||||||
.method(axum::http::Method::DELETE)
|
|
||||||
.uri(&uri)
|
|
||||||
.header(
|
|
||||||
axum::http::header::AUTHORIZATION,
|
|
||||||
super::bearer_auth().await,
|
|
||||||
)
|
|
||||||
.body(axum::body::Body::empty())
|
|
||||||
.unwrap(),
|
|
||||||
)
|
)
|
||||||
.await
|
.await
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user