Files
mattermost/app/license_test.go
Chris b066b6df13 Remove global app references (#7433)
* remove global app references

* test fix

* fix api4 test compilation
2017-09-12 09:19:52 -05:00

39 lines
724 B
Go

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