Various patches
Этот коммит содержится в:
@@ -5,6 +5,8 @@ package api
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/mattermost/platform/utils"
|
||||
)
|
||||
|
||||
func TestGetClientProperties(t *testing.T) {
|
||||
@@ -25,6 +27,24 @@ func TestLogClient(t *testing.T) {
|
||||
if ret, _ := th.BasicClient.LogClient("this is a test"); !ret {
|
||||
t.Fatal("failed to log")
|
||||
}
|
||||
|
||||
enableDeveloper := *utils.Cfg.ServiceSettings.EnableDeveloper
|
||||
defer func() {
|
||||
*utils.Cfg.ServiceSettings.EnableDeveloper = enableDeveloper
|
||||
}()
|
||||
*utils.Cfg.ServiceSettings.EnableDeveloper = false
|
||||
|
||||
th.BasicClient.Logout()
|
||||
|
||||
if _, err := th.BasicClient.LogClient("this is a test"); err == nil {
|
||||
t.Fatal("should have failed")
|
||||
}
|
||||
|
||||
*utils.Cfg.ServiceSettings.EnableDeveloper = true
|
||||
|
||||
if ret, _ := th.BasicClient.LogClient("this is a test"); !ret {
|
||||
t.Fatal("failed to log")
|
||||
}
|
||||
}
|
||||
|
||||
func TestGetPing(t *testing.T) {
|
||||
|
||||
Ссылка в новой задаче
Block a user