Files
mostlymatter/config/common_test.go
Jesse Hallam 9bf5687311 MM-11262: database config store (#10281)
* vendor github.com/jmoiron/sqlx

* MM-11262: introduce a database store

* revert unnecessary fmt.Errorf

* simplify unit test helper methods

* remote TODO re: retry

* relocate initializeConfigurationsTable for clarity

* factor out a commonStore

* acquire database config lock on close for safety

* add missing header

* fix lock comment
2019-02-15 10:05:29 -04:00

18 строки
555 B
Go

package config_test
import (
"testing"
"github.com/mattermost/mattermost-server/model"
)
func prepareExpectedConfig(t *testing.T, expectedCfg *model.Config) *model.Config {
// These fields require special initialization for our tests.
expectedCfg = expectedCfg.Clone()
expectedCfg.MessageExportSettings.GlobalRelaySettings = &model.GlobalRelayMessageExportSettings{}
expectedCfg.PluginSettings.Plugins = make(map[string]map[string]interface{})
expectedCfg.PluginSettings.PluginStates = make(map[string]*model.PluginState)
return expectedCfg
}