summaryrefslogtreecommitdiffstats
path: root/api4/apitestlib.go
diff options
context:
space:
mode:
authorChris <ccbrown112@gmail.com>2017-10-09 14:59:48 -0700
committerGitHub <noreply@github.com>2017-10-09 14:59:48 -0700
commitbff2b5e735ae7fc80157b4108ddbe56be8acb752 (patch)
tree14867d2bff71b6b638b0b358b1f38eb062cb597f /api4/apitestlib.go
parent0f66b6e72621842467d0e368b95ee58f485d4ace (diff)
downloadchat-bff2b5e735ae7fc80157b4108ddbe56be8acb752.tar.gz
chat-bff2b5e735ae7fc80157b4108ddbe56be8acb752.tar.bz2
chat-bff2b5e735ae7fc80157b4108ddbe56be8acb752.zip
Miscellaneous app cleanup (#7594)
* app cleanup * whoops, forgot a file * some minor cleanup * longer container deadline * defensive checks
Diffstat (limited to 'api4/apitestlib.go')
-rw-r--r--api4/apitestlib.go35
1 files changed, 14 insertions, 21 deletions
diff --git a/api4/apitestlib.go b/api4/apitestlib.go
index f3c9c1634..d1da7bfd8 100644
--- a/api4/apitestlib.go
+++ b/api4/apitestlib.go
@@ -46,38 +46,31 @@ type TestHelper struct {
}
func setupTestHelper(enterprise bool) *TestHelper {
+ utils.TranslationsPreInit()
+ utils.LoadConfig("config.json")
+ utils.InitTranslations(utils.Cfg.LocalizationSettings)
+
th := &TestHelper{
App: app.New(),
}
- if th.App.Srv == nil {
- utils.TranslationsPreInit()
- utils.LoadConfig("config.json")
- utils.InitTranslations(utils.Cfg.LocalizationSettings)
- *utils.Cfg.TeamSettings.MaxUsersPerTeam = 50
- *utils.Cfg.RateLimitSettings.Enable = false
- utils.Cfg.EmailSettings.SendEmailNotifications = true
- utils.DisableDebugLogForTest()
- th.App.NewServer()
- th.App.InitStores()
- th.App.Srv.Router = NewRouter()
- th.App.Srv.WebSocketRouter = th.App.NewWebSocketRouter()
- th.App.StartServer()
- Init(th.App, th.App.Srv.Router, true)
- wsapi.Init(th.App, th.App.Srv.WebSocketRouter)
- utils.EnableDebugLogForTest()
- th.App.Srv.Store.MarkSystemRanUnitTests()
+ *utils.Cfg.TeamSettings.MaxUsersPerTeam = 50
+ *utils.Cfg.RateLimitSettings.Enable = false
+ utils.Cfg.EmailSettings.SendEmailNotifications = true
+ utils.DisableDebugLogForTest()
+ th.App.StartServer()
+ Init(th.App, th.App.Srv.Router, true)
+ wsapi.Init(th.App, th.App.Srv.WebSocketRouter)
+ utils.EnableDebugLogForTest()
+ th.App.Srv.Store.MarkSystemRanUnitTests()
- *utils.Cfg.TeamSettings.EnableOpenServer = true
- }
+ *utils.Cfg.TeamSettings.EnableOpenServer = true
utils.SetIsLicensed(enterprise)
if enterprise {
utils.License().Features.SetDefaults()
}
- th.App.Jobs.Store = th.App.Srv.Store
-
th.Client = th.CreateClient()
th.SystemAdminClient = th.CreateClient()
return th