Added a basic homepage
This commit is contained in:
parent
d40640a648
commit
12fd3c04ca
113 changed files with 414 additions and 506 deletions
|
|
@ -1,29 +0,0 @@
|
|||
package handlers
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"net/http"
|
||||
"testing"
|
||||
|
||||
"github.com/labstack/echo/v4"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
func TestGetSetHandlers(t *testing.T) {
|
||||
handlers = []Handler{}
|
||||
assert.Empty(t, GetHandlers())
|
||||
h := new(Pages)
|
||||
Register(h)
|
||||
got := GetHandlers()
|
||||
require.Len(t, got, 1)
|
||||
assert.Equal(t, h, got[0])
|
||||
}
|
||||
|
||||
func TestFail(t *testing.T) {
|
||||
err := fail(errors.New("err message"), "log message")
|
||||
require.IsType(t, new(echo.HTTPError), err)
|
||||
he := err.(*echo.HTTPError)
|
||||
assert.Equal(t, http.StatusInternalServerError, he.Code)
|
||||
assert.Equal(t, "log message: err message", he.Message)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue