MCPcopy Create free account
hub / github.com/Moosync/Moosync / create_test_song

Function create_test_song

src-tauri/database/src/test.rs:45–79  ·  view source on GitHub ↗

Test utility function to create a test song

(title: &str, path: &str)

Source from the content-addressed store, hash-verified

43
44// Test utility function to create a test song
45fn create_test_song(title: &str, path: &str) -> Song {
46 Song {
47 song: QueryableSong {
48 _id: None,
49 title: Some(title.to_string()),
50 path: Some(path.to_string()),
51 song_cover_path_high: None,
52 song_cover_path_low: None,
53 date_added: None,
54 size: Some(0.0),
55 bitrate: Some(0.0),
56 codec: None,
57 duration: Some(300.0),
58 sample_rate: Some(0.0),
59 lyrics: None,
60 type_: SongType::LOCAL,
61 ..Default::default()
62 },
63 album: Some(QueryableAlbum {
64 album_id: None,
65 album_name: Some("Test Album".to_string()),
66 ..Default::default()
67 }),
68 artists: Some(vec![QueryableArtist {
69 artist_id: None,
70 artist_name: Some("Test Artist".to_string()),
71 ..Default::default()
72 }]),
73 genre: Some(vec![QueryableGenre {
74 genre_id: None,
75 genre_name: Some("Test Genre".to_string()),
76 ..Default::default()
77 }]),
78 }
79}
80
81// Test song insertion
82#[test]

Callers 1

test_insert_songFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected