diff options
author | Christopher Speller <crspeller@gmail.com> | 2018-04-03 12:41:02 -0700 |
---|---|---|
committer | Joram Wilander <jwawilander@gmail.com> | 2018-04-03 15:41:02 -0400 |
commit | 80925f7cfd2fe4fe98418119c70e5e36c738f41a (patch) | |
tree | d6dffe4ee56051840bc4b6eb4ca15349c1d26329 /api4 | |
parent | 1476ca5b2d2430858f5cfe8206815ec659393609 (diff) | |
download | chat-80925f7cfd2fe4fe98418119c70e5e36c738f41a.tar.gz chat-80925f7cfd2fe4fe98418119c70e5e36c738f41a.tar.bz2 chat-80925f7cfd2fe4fe98418119c70e5e36c738f41a.zip |
Fixing unit tests for Go 1.10 (#8568)
Diffstat (limited to 'api4')
-rw-r--r-- | api4/command_test.go | 11 | ||||
-rw-r--r-- | api4/file_test.go | 3 |
2 files changed, 13 insertions, 1 deletions
diff --git a/api4/command_test.go b/api4/command_test.go index 3be1af061..8c4ce5d50 100644 --- a/api4/command_test.go +++ b/api4/command_test.go @@ -214,6 +214,17 @@ func TestListCommands(t *testing.T) { defer th.TearDown() Client := th.Client + enableCommands := *th.App.Config().ServiceSettings.EnableCommands + enableOnlyAdminIntegrations := *th.App.Config().ServiceSettings.EnableOnlyAdminIntegrations + defer func() { + th.App.UpdateConfig(func(cfg *model.Config) { cfg.ServiceSettings.EnableCommands = &enableCommands }) + th.App.UpdateConfig(func(cfg *model.Config) { + cfg.ServiceSettings.EnableOnlyAdminIntegrations = &enableOnlyAdminIntegrations + }) + }() + th.App.UpdateConfig(func(cfg *model.Config) { *cfg.ServiceSettings.EnableCommands = true }) + th.App.UpdateConfig(func(cfg *model.Config) { *cfg.ServiceSettings.EnableOnlyAdminIntegrations = true }) + newCmd := &model.Command{ CreatorId: th.BasicUser.Id, TeamId: th.BasicTeam.Id, diff --git a/api4/file_test.go b/api4/file_test.go index a28420c76..9143f4839 100644 --- a/api4/file_test.go +++ b/api4/file_test.go @@ -359,7 +359,8 @@ func TestGetFileHeaders(t *testing.T) { t.Run("js", testHeaders(data, "test.js", "text/plain", false)) t.Run("go", testHeaders(data, "test.go", "application/octet-stream", false)) t.Run("zip", testHeaders(data, "test.zip", "application/zip", false)) - t.Run("exe", testHeaders(data, "test.exe", "application/x-ms", false)) + // Not every platform can recognize these + //t.Run("exe", testHeaders(data, "test.exe", "application/x-ms", false)) t.Run("no extension", testHeaders(data, "test", "application/octet-stream", false)) t.Run("no extension 2", testHeaders([]byte("<html></html>"), "test", "application/octet-stream", false)) } |