Adding album tests #13

Merged
phoenix merged 7 commits from album_tests into devel 2025-03-22 21:19:08 +00:00
Showing only changes of commit 80ca1177a4 - Show all commits

View File

@@ -1,5 +1,7 @@
mod utils { mod utils {
use std::fs; use std::fs;
use std::fs::File;
use std::io::{Read, Write};
use std::path::Path; use std::path::Path;
pub fn get_tests_directory() -> String { pub fn get_tests_directory() -> String {
@@ -14,20 +16,8 @@ mod utils {
false false
} }
} }
}
mod song_tests { pub fn extract_data_from_file(filepath: &String) -> Result<Vec<u8>, std::io::Error> {
use std::fs::File;
use std::io::{Read, Write};
use tempfile::tempdir;
use icarus_models::song;
use icarus_models::types;
use crate::utils;
fn extract_data_from_file(filepath: &String) -> Result<Vec<u8>, std::io::Error> {
match std::fs::File::open(filepath) { match std::fs::File::open(filepath) {
Ok(mut file) => { Ok(mut file) => {
let mut buffer: Vec<u8> = Vec::new(); let mut buffer: Vec<u8> = Vec::new();
@@ -37,6 +27,18 @@ mod song_tests {
Err(err) => Err(err), Err(err) => Err(err),
} }
} }
}
mod song_tests {
// use std::fs::File;
// use std::io::{Read, Write};
use tempfile::tempdir;
use icarus_models::song;
use icarus_models::types;
use crate::utils;
#[test] #[test]
fn test_song_to_data() { fn test_song_to_data() {