github.com/masterhung0112/hk_server/v5@v5.0.0-20220302090640-ec71aef15e1c/cmd/hkserver/commands/permissions_test.go (about)

     1  // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
     2  // See LICENSE.txt for license information.
     3  
     4  package commands
     5  
     6  import (
     7  	"testing"
     8  
     9  	"github.com/masterhung0112/hk_server/v5/shared/i18n"
    10  	"github.com/stretchr/testify/assert"
    11  )
    12  
    13  func TestPermissionsExport_rejectsUnlicensed(t *testing.T) {
    14  	th := Setup(t).InitBasic()
    15  	defer th.TearDown()
    16  
    17  	actual, _ := th.RunCommandWithOutput(t, "permissions", "export")
    18  	assert.Contains(t, actual, i18n.T("cli.license.critical"))
    19  }
    20  
    21  func TestPermissionsImport_rejectsUnlicensed(t *testing.T) {
    22  	th := Setup(t).InitBasic()
    23  	defer th.TearDown()
    24  
    25  	actual, _ := th.RunCommandWithOutput(t, "permissions", "import")
    26  
    27  	assert.Contains(t, actual, i18n.T("cli.license.critical"))
    28  }