MM-21898 - Part 1: Generate and use an interface instead of *A… (#13840)
* Generate and use an interface instead of *App
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
66fc096768
Коммит
17523fa5d9
@@ -73,7 +73,7 @@ func setupMultiPluginApiTest(t *testing.T, pluginCodes []string, pluginManifests
|
||||
defer os.RemoveAll(pluginDir)
|
||||
defer os.RemoveAll(webappPluginDir)
|
||||
|
||||
env, err := plugin.NewEnvironment(app.NewPluginAPI, pluginDir, webappPluginDir, app.Log)
|
||||
env, err := plugin.NewEnvironment(app.NewPluginAPI, pluginDir, webappPluginDir, app.Log())
|
||||
require.NoError(t, err)
|
||||
|
||||
require.Equal(t, len(pluginCodes), len(pluginIds))
|
||||
@@ -336,7 +336,7 @@ func TestPluginAPIGetFile(t *testing.T) {
|
||||
info, err := th.App.DoUploadFile(uploadTime, th.BasicTeam.Id, th.BasicChannel.Id, th.BasicUser.Id, filename, fileData)
|
||||
require.Nil(t, err)
|
||||
defer func() {
|
||||
th.App.Srv.Store.FileInfo().PermanentDelete(info.Id)
|
||||
th.App.Srv().Store.FileInfo().PermanentDelete(info.Id)
|
||||
th.App.RemoveFile(info.Path)
|
||||
}()
|
||||
|
||||
@@ -528,7 +528,7 @@ func TestPluginAPIGetPlugins(t *testing.T) {
|
||||
defer os.RemoveAll(pluginDir)
|
||||
defer os.RemoveAll(webappPluginDir)
|
||||
|
||||
env, err := plugin.NewEnvironment(th.App.NewPluginAPI, pluginDir, webappPluginDir, th.App.Log)
|
||||
env, err := plugin.NewEnvironment(th.App.NewPluginAPI, pluginDir, webappPluginDir, th.App.Log())
|
||||
require.NoError(t, err)
|
||||
|
||||
pluginIDs := []string{"pluginid1", "pluginid2", "pluginid3"}
|
||||
@@ -612,7 +612,7 @@ func TestInstallPlugin(t *testing.T) {
|
||||
*cfg.PluginSettings.ClientDirectory = webappPluginDir
|
||||
})
|
||||
|
||||
env, err := plugin.NewEnvironment(app.NewPluginAPI, pluginDir, webappPluginDir, app.Log)
|
||||
env, err := plugin.NewEnvironment(app.NewPluginAPI, pluginDir, webappPluginDir, app.Log())
|
||||
require.NoError(t, err)
|
||||
|
||||
app.SetPluginsEnvironment(env)
|
||||
@@ -1035,7 +1035,7 @@ func TestPluginCreatePostWithUploadedFile(t *testing.T) {
|
||||
fileInfo, err := api.UploadFile(data, channelId, filename)
|
||||
require.Nil(t, err)
|
||||
defer func() {
|
||||
th.App.Srv.Store.FileInfo().PermanentDelete(fileInfo.Id)
|
||||
th.App.Srv().Store.FileInfo().PermanentDelete(fileInfo.Id)
|
||||
th.App.RemoveFile(fileInfo.Path)
|
||||
}()
|
||||
|
||||
|
||||
Ссылка в новой задаче
Block a user