bump mockery from v1.1.2 to v2.14.0

Command-line params changed their names,
and old ones won't work anymore.
This commit is contained in:
Dmitry Verkhoturov
2022-09-12 17:22:34 -05:00
committed by Umputun
parent 5fee19f6c7
commit e77dc33333
4 changed files with 37 additions and 9 deletions
+2 -2
View File
@@ -11,8 +11,8 @@ import (
"github.com/umputun/remark42/backend/app/store"
)
// NOTE: mockery works from linked to go-path and with go generate
//go:generate sh -c "mockery -inpkg -name Interface -print > /tmp/engine-mock.tmp && mv /tmp/engine-mock.tmp engine_mock.go"
// NOTE: mockery should be installed globally and works with `go generate ./...`
//go:generate mockery --inpackage --name Interface --filename engine_mock.go
// Interface defines methods provided by low-level storage engine
type Interface interface {
+16 -1
View File
@@ -1,4 +1,4 @@
// Code generated by mockery v1.1.2. DO NOT EDIT.
// Code generated by mockery v2.14.0. DO NOT EDIT.
package engine
@@ -229,3 +229,18 @@ func (_m *MockInterface) UserDetail(req UserDetailRequest) ([]UserDetailEntry, e
return r0, r1
}
type mockConstructorTestingTNewMockInterface interface {
mock.TestingT
Cleanup(func())
}
// NewMockInterface creates a new instance of MockInterface. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
func NewMockInterface(t mockConstructorTestingTNewMockInterface) *MockInterface {
mock := &MockInterface{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}
+3 -5
View File
@@ -3,7 +3,8 @@
// Service object encloses Store and add common methods, this is the one consumer should use.
package image
//go:generate sh -c "mockery -inpkg -name Store -print > /tmp/mock.tmp && mv /tmp/mock.tmp image_mock.go"
// NOTE: mockery should be installed globally and works with `go generate ./...`
//go:generate mockery --inpackage --name Store --filename image_mock.go
import (
"bytes"
@@ -61,9 +62,6 @@ type StoreInfo struct {
FirstStagingImageTS time.Time
}
// To regenerate mock run from this directory:
// sh -c "mockery -inpkg -name Store -print > /tmp/image-mock.tmp && mv /tmp/image-mock.tmp image_mock.go"
// Store defines interface for saving and loading pictures.
// Declares two-stage save with Commit. Save stores to staging area and Commit moves to the final location.
// Two-stage commit scheme is used for not storing images which are uploaded but later never used in the comments,
@@ -367,7 +365,7 @@ func Sha1Str(s string) string {
// ID would look like: "cached_images/<sha1-of-image-url-hostname>-<sha1-of-image-entire-url>"
// <sha1-of-image-url-hostname> - would allow us to identify all images from particular site if ever needed
// <sha1-of-image-entire-url> - would allow us to avoid storing duplicates of the same image
// (as accurate as deduplication based on potentially mutable url can be)
// (as accurate as deduplication based on potentially mutable url can be)
func CachedImgID(imgURL string) (string, error) {
parsedURL, err := url.Parse(imgURL)
if err != nil {
+16 -1
View File
@@ -1,4 +1,4 @@
// Code generated by mockery v1.1.2. DO NOT EDIT.
// Code generated by mockery v2.14.0. DO NOT EDIT.
package image
@@ -113,3 +113,18 @@ func (_m *MockStore) Save(id string, img []byte) error {
return r0
}
type mockConstructorTestingTNewMockStore interface {
mock.TestingT
Cleanup(func())
}
// NewMockStore creates a new instance of MockStore. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
func NewMockStore(t mockConstructorTestingTNewMockStore) *MockStore {
mock := &MockStore{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}