fix config cli option (#7850)
Этот коммит содержится в:
29
cmd/platform/config_test.go
Обычный файл
29
cmd/platform/config_test.go
Обычный файл
@@ -0,0 +1,29 @@
|
||||
// Copyright (c) 2017-present Mattermost, Inc. All Rights Reserved.
|
||||
// See License.txt for license information.
|
||||
|
||||
package main
|
||||
|
||||
import (
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
"github.com/mattermost/mattermost-server/model"
|
||||
)
|
||||
|
||||
func TestConfigValidate(t *testing.T) {
|
||||
dir, err := ioutil.TempDir("", "")
|
||||
require.NoError(t, err)
|
||||
defer os.RemoveAll(dir)
|
||||
|
||||
path := filepath.Join(dir, "config.json")
|
||||
config := &model.Config{}
|
||||
config.SetDefaults()
|
||||
require.NoError(t, ioutil.WriteFile(path, []byte(config.ToJson()), 0600))
|
||||
|
||||
assert.Contains(t, checkCommand(t, "--config", path, "config", "validate"), "The document is valid")
|
||||
}
|
||||
Ссылка в новой задаче
Block a user