@@ -13,6 +13,7 @@ import (
|
||||
"net/http"
|
||||
"net/url"
|
||||
"path/filepath"
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
"github.com/mattermost/mattermost-server/v6/app/request"
|
||||
@@ -141,6 +142,11 @@ func (api *PluginAPI) GetLicense() *model.License {
|
||||
return api.app.Srv().License()
|
||||
}
|
||||
|
||||
func (api *PluginAPI) IsEnterpriseReady() bool {
|
||||
result, _ := strconv.ParseBool(model.BuildEnterpriseReady)
|
||||
return result
|
||||
}
|
||||
|
||||
func (api *PluginAPI) GetServerVersion() string {
|
||||
return model.CurrentVersion
|
||||
}
|
||||
|
||||
@@ -1922,3 +1922,15 @@ func TestPluginAPIUpdateCommand(t *testing.T) {
|
||||
require.Equal(t, team1.Id, newCmd4.TeamId)
|
||||
|
||||
}
|
||||
|
||||
func TestPluginAPIIsEnterpriseReady(t *testing.T) {
|
||||
oldValue := model.BuildEnterpriseReady
|
||||
defer func() { model.BuildEnterpriseReady = oldValue }()
|
||||
|
||||
model.BuildEnterpriseReady = "true"
|
||||
th := Setup(t)
|
||||
defer th.TearDown()
|
||||
api := th.SetupPluginAPI()
|
||||
|
||||
assert.Equal(t, true, api.IsEnterpriseReady())
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user