mess about with media a bit more

This commit is contained in:
tsmethurst
2021-03-29 17:03:25 +02:00
parent 6ed16ace85
commit 39aca2025f
14 changed files with 953 additions and 79 deletions

View File

@ -3,9 +3,10 @@
package media
import (
multipart "mime/multipart"
io "io"
mock "github.com/stretchr/testify/mock"
model "github.com/superseriousbusiness/gotosocial/internal/db/model"
)
// MockMediaHandler is an autogenerated mock type for the MediaHandler type
@ -13,22 +14,22 @@ type MockMediaHandler struct {
mock.Mock
}
// SetHeaderForAccountID provides a mock function with given fields: f, id
func (_m *MockMediaHandler) SetHeaderForAccountID(f multipart.File, id string) (*HeaderInfo, error) {
ret := _m.Called(f, id)
// SetHeaderOrAvatarForAccountID provides a mock function with given fields: f, accountID, headerOrAvi
func (_m *MockMediaHandler) SetHeaderOrAvatarForAccountID(f io.Reader, accountID string, headerOrAvi string) (*model.MediaAttachment, error) {
ret := _m.Called(f, accountID, headerOrAvi)
var r0 *HeaderInfo
if rf, ok := ret.Get(0).(func(multipart.File, string) *HeaderInfo); ok {
r0 = rf(f, id)
var r0 *model.MediaAttachment
if rf, ok := ret.Get(0).(func(io.Reader, string, string) *model.MediaAttachment); ok {
r0 = rf(f, accountID, headerOrAvi)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*HeaderInfo)
r0 = ret.Get(0).(*model.MediaAttachment)
}
}
var r1 error
if rf, ok := ret.Get(1).(func(multipart.File, string) error); ok {
r1 = rf(f, id)
if rf, ok := ret.Get(1).(func(io.Reader, string, string) error); ok {
r1 = rf(f, accountID, headerOrAvi)
} else {
r1 = ret.Error(1)
}