@@ -15,7 +15,7 @@ import (
|
||||
|
||||
func Setup(ctx context.Context, ctrl *gomock.Controller) (*images.Service, *mock.Client) {
|
||||
valkey := mock.NewClient(ctrl)
|
||||
return images.New(testdata.FS(), &config.ImageConfig{Concurency: 1, Quality: 80}, valkey), valkey
|
||||
return images.New(testdata.FS(), &config.Image{Concurency: 1, Quality: 80}, valkey), valkey
|
||||
}
|
||||
|
||||
func BenchmarkService_GetImage(b *testing.B) {
|
||||
@@ -29,7 +29,7 @@ func BenchmarkService_GetImage(b *testing.B) {
|
||||
for b.Loop() {
|
||||
valkeyClient.EXPECT().Do(gomock.Any(), gomock.Any()).Return(mock.ErrorResult(errors.New("adf")))
|
||||
valkeyClient.EXPECT().Do(gomock.Any(), gomock.Any()).Return(mock.Result(valkey.ValkeyMessage{}))
|
||||
_, _, err = srv.GetImage(b.Context(), uid, images.Options{Width: 500, Quality: 80})
|
||||
_, _, err = srv.GetScaledImage(b.Context(), uid, images.Options{Width: 500, Quality: 80})
|
||||
if err != nil {
|
||||
b.Error(err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user