This commit is contained in:
toom1996
2026-09-17 22:51:00 +08:00
parent 766c691eb3
commit f7ae917603
33 changed files with 8181 additions and 3094 deletions

View File

@ -9,6 +9,7 @@ import (
"strings"
"testing"
"fashionapi/internal/dto"
"fashionapi/internal/pkg/storage"
)
@ -25,12 +26,12 @@ func TestFetchImagesCleansUpOnFailure(t *testing.T) {
return
}
w.Header().Set("Content-Type", "image/jpeg")
_, _ = w.Write([]byte("fakeimagebytes"))
_, _ = w.Write([]byte("fakeimagebytes" + r.URL.Path))
}))
defer srv.Close()
urls := []string{srv.URL + "/ok1.jpg", srv.URL + "/ok2.jpg", srv.URL + "/bad.jpg"}
_, out, _, keys, failed := s.fetchImages(context.Background(), urls, "runway")
_, out, keys, failed := s.fetchImages(context.Background(), urls, "runway", dto.IngestKindRunway)
if !failed {
t.Fatalf("expected failed=true when one image errors")
}