github.com/iDevoid/mattermost-server@v5.11.1+incompatible/cmd/mattermost/commands/sampledata_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/stretchr/testify/require"
    10  )
    11  
    12  func TestSampledataBadParameters(t *testing.T) {
    13  	th := Setup().InitBasic()
    14  	defer th.TearDown()
    15  
    16  	// should fail because you need at least 1 worker
    17  	require.Error(t, th.RunCommand(t, "sampledata", "--workers", "0"))
    18  
    19  	// should fail because you have more team memberships than teams
    20  	require.Error(t, th.RunCommand(t, "sampledata", "--teams", "10", "--teams-memberships", "11"))
    21  
    22  	// should fail because you have more channel memberships than channels per team
    23  	require.Error(t, th.RunCommand(t, "sampledata", "--channels-per-team", "10", "--channel-memberships", "11"))
    24  }