summaryrefslogtreecommitdiffstats
path: root/cmd/commands/config_flag_test.go
diff options
context:
space:
mode:
authorChristopher Speller <crspeller@gmail.com>2018-05-17 12:40:40 -0700
committerGitHub <noreply@github.com>2018-05-17 12:40:40 -0700
commit11cbb597471127c1b29e78e6cad0a1a4d93ea24c (patch)
tree0eceb950872c7234348f0b41d4492073908840d0 /cmd/commands/config_flag_test.go
parent1f6c271b3bedd6656ae7155714423b1b39a669c1 (diff)
downloadchat-11cbb597471127c1b29e78e6cad0a1a4d93ea24c.tar.gz
chat-11cbb597471127c1b29e78e6cad0a1a4d93ea24c.tar.bz2
chat-11cbb597471127c1b29e78e6cad0a1a4d93ea24c.zip
Renaming platform binary to mattermost. (#8801)
Diffstat (limited to 'cmd/commands/config_flag_test.go')
-rw-r--r--cmd/commands/config_flag_test.go49
1 files changed, 0 insertions, 49 deletions
diff --git a/cmd/commands/config_flag_test.go b/cmd/commands/config_flag_test.go
deleted file mode 100644
index 59178b620..000000000
--- a/cmd/commands/config_flag_test.go
+++ /dev/null
@@ -1,49 +0,0 @@
-// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
-// See License.txt for license information.
-
-package commands
-
-import (
- "io/ioutil"
- "os"
- "path/filepath"
- "testing"
-
- "github.com/stretchr/testify/require"
-
- "encoding/json"
-
- "github.com/mattermost/mattermost-server/cmd"
- "github.com/mattermost/mattermost-server/utils"
-)
-
-func TestConfigFlag(t *testing.T) {
- dir, err := ioutil.TempDir("", "")
- require.NoError(t, err)
- defer os.RemoveAll(dir)
-
- utils.TranslationsPreInit()
- config, _, _, err := utils.LoadConfig("config.json")
- require.Nil(t, err)
- configPath := filepath.Join(dir, "foo.json")
- require.NoError(t, ioutil.WriteFile(configPath, []byte(config.ToJson()), 0600))
-
- timezones := utils.LoadTimezones("timezones.json")
- tzConfigPath := filepath.Join(dir, "timezones.json")
- timezoneData, _ := json.Marshal(timezones)
- require.NoError(t, ioutil.WriteFile(tzConfigPath, timezoneData, 0600))
-
- i18n, ok := utils.FindDir("i18n")
- require.True(t, ok)
- require.NoError(t, utils.CopyDir(i18n, filepath.Join(dir, "i18n")))
-
- prevDir, err := os.Getwd()
- require.NoError(t, err)
- defer os.Chdir(prevDir)
- os.Chdir(dir)
-
- require.Error(t, cmd.RunCommand(t, "version"))
- cmd.CheckCommand(t, "--config", "foo.json", "version")
- cmd.CheckCommand(t, "--config", "./foo.json", "version")
- cmd.CheckCommand(t, "--config", configPath, "version")
-}