diff --git a/engine/import_test.go b/engine/import_test.go index 6a29e6f..1981e63 100644 --- a/engine/import_test.go +++ b/engine/import_test.go @@ -3,6 +3,7 @@ package engine_test import ( "context" "os" + "path" "path/filepath" "testing" "time" @@ -19,7 +20,7 @@ import ( func TestImportMaloja(t *testing.T) { - src := "../static/maloja_import_test.json" + src := path.Join("..", "test_assets", "maloja_import_test.json") destDir := filepath.Join(cfg.ConfigDir(), "import") dest := filepath.Join(destDir, "maloja_import_test.json") @@ -44,7 +45,7 @@ func TestImportMaloja(t *testing.T) { func TestImportSpotify(t *testing.T) { - src := "../static/Streaming_History_Audio_spotify_import_test.json" + src := path.Join("..", "test_assets", "Streaming_History_Audio_spotify_import_test.json") destDir := filepath.Join(cfg.ConfigDir(), "import") dest := filepath.Join(destDir, "Streaming_History_Audio_spotify_import_test.json") @@ -72,7 +73,7 @@ func TestImportSpotify(t *testing.T) { func TestImportLastFM(t *testing.T) { - src := "../static/recenttracks-shoko2-1749776100.json" + src := path.Join("..", "test_assets", "recenttracks-shoko2-1749776100.json") destDir := filepath.Join(cfg.ConfigDir(), "import") dest := filepath.Join(destDir, "recenttracks-shoko2-1749776100.json") @@ -119,7 +120,7 @@ func TestImportLastFM(t *testing.T) { func TestImportListenBrainz(t *testing.T) { - src := "../static/listenbrainz_shoko1_1749780844.zip" + src := path.Join("..", "test_assets", "listenbrainz_shoko1_1749780844.zip") destDir := filepath.Join(cfg.ConfigDir(), "import") dest := filepath.Join(destDir, "listenbrainz_shoko1_1749780844.zip") diff --git a/engine/long_test.go b/engine/long_test.go index fad9f16..498bd08 100644 --- a/engine/long_test.go +++ b/engine/long_test.go @@ -664,9 +664,9 @@ func TestArtistReplaceImage(t *testing.T) { buf := &bytes.Buffer{} mpw := multipart.NewWriter(buf) mpw.WriteField("artist_id", "1") - w, err := mpw.CreateFormFile("image", path.Join("..", "static", "yuu.jpg")) + w, err := mpw.CreateFormFile("image", path.Join("..", "test_assets", "yuu.jpg")) require.NoError(t, err) - f, err := os.Open(path.Join("..", "static", "yuu.jpg")) + f, err := os.Open(path.Join("..", "test_assets", "yuu.jpg")) require.NoError(t, err) defer f.Close() _, err = io.Copy(w, f) @@ -702,9 +702,9 @@ func TestAlbumReplaceImage(t *testing.T) { buf := &bytes.Buffer{} mpw := multipart.NewWriter(buf) mpw.WriteField("album_id", "1") - w, err := mpw.CreateFormFile("image", path.Join("..", "static", "yuu.jpg")) + w, err := mpw.CreateFormFile("image", path.Join("..", "test_assets", "yuu.jpg")) require.NoError(t, err) - f, err := os.Open(path.Join("..", "static", "yuu.jpg")) + f, err := os.Open(path.Join("..", "test_assets", "yuu.jpg")) require.NoError(t, err) defer f.Close() _, err = io.Copy(w, f) diff --git a/internal/catalog/images_test.go b/internal/catalog/images_test.go index e0077e9..9e1bc32 100644 --- a/internal/catalog/images_test.go +++ b/internal/catalog/images_test.go @@ -18,7 +18,7 @@ import ( func TestImageLifecycle(t *testing.T) { // serve yuu.jpg as test image - imageBytes, err := os.ReadFile(filepath.Join("static", "yuu.jpg")) + imageBytes, err := os.ReadFile(filepath.Join("test_assets", "yuu.jpg")) require.NoError(t, err) server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "image/jpeg") diff --git a/static/Streaming_History_Audio_spotify_import_test.json b/test_assets/Streaming_History_Audio_spotify_import_test.json similarity index 100% rename from static/Streaming_History_Audio_spotify_import_test.json rename to test_assets/Streaming_History_Audio_spotify_import_test.json diff --git a/static/listenbrainz_shoko1_1749780844.zip b/test_assets/listenbrainz_shoko1_1749780844.zip similarity index 100% rename from static/listenbrainz_shoko1_1749780844.zip rename to test_assets/listenbrainz_shoko1_1749780844.zip diff --git a/static/maloja_import_test.json b/test_assets/maloja_import_test.json similarity index 100% rename from static/maloja_import_test.json rename to test_assets/maloja_import_test.json diff --git a/static/recenttracks-shoko2-1749776100.json b/test_assets/recenttracks-shoko2-1749776100.json similarity index 100% rename from static/recenttracks-shoko2-1749776100.json rename to test_assets/recenttracks-shoko2-1749776100.json diff --git a/static/yuu.jpg b/test_assets/yuu.jpg similarity index 100% rename from static/yuu.jpg rename to test_assets/yuu.jpg