Files
mattermost/app/license_test.go

42 lines
742 B
Go
Raw Normal View History

// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved.
// See License.txt for license information.
package app
import (
2017-09-06 23:05:10 -07:00
//"github.com/mattermost/mattermost-server/model"
"testing"
2017-09-06 17:12:54 -05:00
2017-09-06 23:05:10 -07:00
"github.com/mattermost/mattermost-server/utils"
)
func TestLoadLicense(t *testing.T) {
2017-09-06 17:12:54 -05:00
a := Global()
a.Setup()
2017-09-06 17:12:54 -05:00
a.LoadLicense()
if utils.IsLicensed() {
t.Fatal("shouldn't have a valid license")
}
}
func TestSaveLicense(t *testing.T) {
2017-09-06 17:12:54 -05:00
a := Global()
a.Setup()
b1 := []byte("junk")
2017-09-06 17:12:54 -05:00
if _, err := a.SaveLicense(b1); err == nil {
t.Fatal("shouldn't have saved license")
}
}
func TestRemoveLicense(t *testing.T) {
2017-09-06 17:12:54 -05:00
a := Global()
a.Setup()
2017-09-06 17:12:54 -05:00
if err := a.RemoveLicense(); err != nil {
t.Fatal("should have removed license")
}
}