Plugin framework: add ability to install other plugins to the… (#12232)

* add ability to upload other plugins to the plugin API

* generated client rpc glue code

* fix UploadPlugin API signature

* generated plugin mocks

* added upload plugin test

* removed unused comment

* using single line to call InstallPlugin with file Reader

* fix minimum server version

* added successful plugin upload test

* renamed UploadPlugin to InstallPlugin
Этот коммит содержится в:
Nikhil Ranjan
2019-10-17 20:57:55 +02:00
коммит произвёл Ali Farooq
родитель db97b49e7a
Коммит d7ee3553fa
5 изменённых файлов: 119 добавлений и 0 удалений

Просмотреть файл

@@ -5,6 +5,8 @@
package plugintest
import (
io "io"
model "github.com/mattermost/mattermost-server/model"
mock "github.com/stretchr/testify/mock"
)
@@ -2783,3 +2785,28 @@ func (_m *API) UploadFile(data []byte, channelId string, filename string) (*mode
return r0, r1
}
// InstallPlugin provides a mock function with given fields: file, replace
func (_m *API) InstallPlugin(file io.Reader, replace bool) (*model.Manifest, *model.AppError) {
ret := _m.Called(file, replace)
var r0 *model.Manifest
if rf, ok := ret.Get(0).(func(io.Reader, bool) *model.Manifest); ok {
r0 = rf(file, replace)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*model.Manifest)
}
}
var r1 *model.AppError
if rf, ok := ret.Get(1).(func(io.Reader, bool) *model.AppError); ok {
r1 = rf(file, replace)
} else {
if ret.Get(1) != nil {
r1 = ret.Get(1).(*model.AppError)
}
}
return r0, r1
}