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