Added flac files used for testing (#161)

* Added flac files used for testing

* Refactor test

* Added CoverArt file for test files

* Added album json file for testing

* Modifying test json file

* Modifying test file for consistency

* Test refactoring

* Test file changes

* Removing commented code

* Removing files used for testing

* Removing placeholder

* Code formatting
This commit was merged in pull request #161.
This commit is contained in:
KD
2025-07-25 16:09:01 -04:00
committed by GitHub
parent a150d34c6c
commit a987e438c4
14 changed files with 106 additions and 26 deletions
+33 -26
View File
@@ -247,7 +247,7 @@ mod tests {
) -> Result<axum::response::Response, std::convert::Infallible> {
// Create multipart form
let mut form = MultipartForm::default();
let _ = form.add_file("flac", "tests/Machine_gun/track01.flac");
let _ = form.add_file("flac", "tests/IAmWe/track01.flac");
// Create request
let content_type = form.content_type();
@@ -331,7 +331,7 @@ mod tests {
app: &axum::Router,
) -> Result<axum::response::Response, std::convert::Infallible> {
let mut form = MultipartForm::default();
let _ = form.add_file("jpg", "tests/Machine_gun/160809_machinegun.jpg");
let _ = form.add_file("jpg", "tests/IAmWe/Coverart.jpg");
// Create request
let content_type = form.content_type();
@@ -407,22 +407,7 @@ mod tests {
song_queue_id: &uuid::Uuid,
user_id: &uuid::Uuid,
) -> Result<axum::response::Response, std::convert::Infallible> {
let payload = serde_json::json!({
"title": "Power of Soul",
"artist": "Jimmi Hendrix",
"album_artist": "Jimmi Hendrix",
"album": "Machine Gun",
"genre": "Psychadelic Rock",
"date": "2016-01-01",
"track": 1,
"disc": 1,
"track_count": 11,
"disc_count": 1,
"duration": 330,
"audio_type": "flac",
"user_id": user_id,
"song_queue_id": song_queue_id
});
let payload = payload_data::create_song(song_queue_id, user_id).await;
let req = axum::http::Request::builder()
.method(axum::http::Method::POST)
@@ -653,17 +638,39 @@ mod tests {
serde_json::json!(
{
"song_queue_id": song_queue_id,
"album" : "Machine Gun: The FillMore East First Show",
"album_artist" : "Jimi Hendrix",
"artist" : "Jimi Hendrix",
"album" : "I",
"album_artist" : "Kuoth",
"artist" : "Kuoth",
"disc" : 1,
"disc_count" : 1,
"duration" : 330,
"genre" : "Psychadelic Rock",
"title" : "Power of Soul",
"duration" : 139,
"genre" : "Alternative Hip-Hop",
"title" : "Hypocrite Like The Rest",
"track" : 1,
"track_count" : 11,
"year" : 2016
"track_count" : 9,
"year" : 2020
})
}
pub async fn create_song(
song_queue_id: &uuid::Uuid,
user_id: &uuid::Uuid,
) -> serde_json::Value {
serde_json::json!({
"title" : "Hypocrite Like The Rest",
"artist" : "Kuoth",
"album_artist": "Kuoth",
"album": "I",
"genre" : "Alternative Hip-Hop",
"date": "2020-01-01",
"track": 1,
"disc": 1,
"track_count": 9,
"disc_count": 1,
"duration": 139,
"audio_type": "flac",
"user_id": user_id,
"song_queue_id": song_queue_id
})
}
}