update
This commit is contained in:
@ -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")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user