Restore config after finisht the test case (#9085)

Этот коммит содержится в:
Carlos Tadeu Panato Junior
2018-07-11 12:58:16 +02:00
коммит произвёл GitHub
родитель 7c08ff9986
Коммит 7ed712f938
6 изменённых файлов: 152 добавлений и 5 удалений

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

@@ -28,6 +28,15 @@ func TestGetImage(t *testing.T) {
require.NoError(t, err)
r.Header.Set(model.HEADER_AUTH, th.Client.AuthType+" "+th.Client.AuthToken)
imageProxyType := th.App.Config().ServiceSettings.ImageProxyType
imageProxyOptions := th.App.Config().ServiceSettings.ImageProxyOptions
imageProxyURL := th.App.Config().ServiceSettings.ImageProxyURL
defer func() {
th.App.UpdateConfig(func(cfg *model.Config) { cfg.ServiceSettings.ImageProxyType = imageProxyType })
th.App.UpdateConfig(func(cfg *model.Config) { cfg.ServiceSettings.ImageProxyOptions = imageProxyOptions })
th.App.UpdateConfig(func(cfg *model.Config) { cfg.ServiceSettings.ImageProxyOptions = imageProxyURL })
}()
th.App.UpdateConfig(func(cfg *model.Config) {
cfg.ServiceSettings.ImageProxyType = nil
})