29 lines
530 B
Go
29 lines
530 B
Go
package metrics
|
|
|
|
import (
|
|
"net/http"
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
|
|
"dev.sum7.eu/genofire/golang-lib/web/webtest"
|
|
)
|
|
|
|
func TestMetricsLoaded(t *testing.T) {
|
|
assert := assert.New(t)
|
|
s, err := webtest.New(Register)
|
|
assert.NoError(err)
|
|
defer s.Close()
|
|
assert.NotNil(s)
|
|
|
|
// GET
|
|
err = s.Request(http.MethodGet, "/metrics", nil, http.StatusOK, nil)
|
|
assert.NoError(err)
|
|
|
|
UP = func() bool { return false }
|
|
|
|
// GET
|
|
err = s.Request(http.MethodGet, "/metrics", nil, http.StatusOK, nil)
|
|
assert.NoError(err)
|
|
}
|