Browse Source

add test

pull/103/head
lixiaoshuang 5 years ago
parent
commit
e0824b8194
  1. 19
      dtmsvr/api_http_test.go

19
dtmsvr/api_http_test.go

@ -0,0 +1,19 @@
package dtmsvr
import (
"github.com/stretchr/testify/assert"
"github.com/yedf/dtm/common"
"github.com/yedf/dtm/dtmcli"
"github.com/yedf/dtm/dtmcli/dtmimp"
"testing"
)
func TestDtmMetrics(t *testing.T) {
common.MustLoadConfig()
dtmcli.SetCurrentDBType(common.Config.ExamplesDB.Driver)
PopulateDB(true)
StartSvr()
rest, err := dtmimp.RestyClient.R().Get("http://localhost:36789/api/metrics")
assert.Nil(t, err)
assert.Equal(t, rest.StatusCode(), 200)
}
Loading…
Cancel
Save