github.com/qichengzx/mattermost-server@v4.5.1-0.20180604164826-2c75247c97d0+incompatible/plugin/pluginenv/options_test.go (about) 1 package pluginenv 2 3 import ( 4 "testing" 5 6 "github.com/stretchr/testify/assert" 7 "github.com/stretchr/testify/require" 8 9 "github.com/mattermost/mattermost-server/model" 10 "github.com/mattermost/mattermost-server/plugin/rpcplugin" 11 ) 12 13 func TestDefaultSupervisorProvider(t *testing.T) { 14 _, err := DefaultSupervisorProvider(&model.BundleInfo{}) 15 assert.Error(t, err) 16 17 _, err = DefaultSupervisorProvider(&model.BundleInfo{ 18 Manifest: &model.Manifest{}, 19 }) 20 assert.Error(t, err) 21 22 supervisor, err := DefaultSupervisorProvider(&model.BundleInfo{ 23 Manifest: &model.Manifest{ 24 Backend: &model.ManifestBackend{ 25 Executable: "foo", 26 }, 27 }, 28 }) 29 require.NoError(t, err) 30 _, ok := supervisor.(*rpcplugin.Supervisor) 31 assert.True(t, ok) 32 }