The main package was used unnecessarily without a main function. ```release-note NONE ```
23 строки
514 B
Go
23 строки
514 B
Go
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
|
// See LICENSE.txt for license information.
|
|
|
|
package server
|
|
|
|
import (
|
|
"net/http"
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
)
|
|
|
|
func TestAPI(t *testing.T) {
|
|
e := Setup(t)
|
|
e.CreateClients()
|
|
|
|
t.Run("404", func(t *testing.T) {
|
|
resp, err := e.ServerClient.DoAPIRequestBytes("POST", e.ServerClient.URL+"/plugins/"+"playbooks"+"/api/v0/nothing", nil, "")
|
|
assert.Error(t, err)
|
|
assert.Equal(t, http.StatusNotFound, resp.StatusCode)
|
|
})
|
|
}
|