diff options
Diffstat (limited to 'api/license_test.go')
-rw-r--r-- | api/license_test.go | 51 |
1 files changed, 0 insertions, 51 deletions
diff --git a/api/license_test.go b/api/license_test.go deleted file mode 100644 index 47586151a..000000000 --- a/api/license_test.go +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved. -// See License.txt for license information. - -package api - -import ( - "testing" -) - -func TestGetLicenceConfig(t *testing.T) { - th := Setup().InitBasic() - defer th.TearDown() - - Client := th.BasicClient - - if result, err := Client.GetClientLicenceConfig(""); err != nil { - t.Fatal(err) - } else { - cfg := result.Data.(map[string]string) - - if _, ok := cfg["IsLicensed"]; !ok { - t.Fatal(cfg) - } - - // test etag caching - if cache_result, err := Client.GetClientLicenceConfig(result.Etag); err != nil { - t.Fatal(err) - } else if len(cache_result.Data.(map[string]string)) != 0 { - t.Log(cache_result.Data) - t.Fatal("cache should be empty") - } - - th.App.SetClientLicense(map[string]string{"IsLicensed": "true"}) - - if cache_result, err := Client.GetClientLicenceConfig(result.Etag); err != nil { - t.Fatal(err) - } else if len(cache_result.Data.(map[string]string)) == 0 { - t.Fatal("result should not be empty") - } - - th.App.SetClientLicense(map[string]string{"SomeFeature": "true", "IsLicensed": "true"}) - - if cache_result, err := Client.GetClientLicenceConfig(result.Etag); err != nil { - t.Fatal(err) - } else if len(cache_result.Data.(map[string]string)) == 0 { - t.Fatal("result should not be empty") - } - - th.App.SetClientLicense(map[string]string{"IsLicensed": "false"}) - } -} |