Browse Source

add test

pull/103/head
lixiaoshuang 4 years ago
parent
commit
3e685aa39e
  1. 8
      test/api_http_test.go

8
dtmsvr/api_http_test.go → test/api_http_test.go

@ -1,18 +1,12 @@
package dtmsvr package test
import ( import (
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"github.com/yedf/dtm/common"
"github.com/yedf/dtm/dtmcli"
"github.com/yedf/dtm/dtmcli/dtmimp" "github.com/yedf/dtm/dtmcli/dtmimp"
"testing" "testing"
) )
func TestDtmMetrics(t *testing.T) { 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") rest, err := dtmimp.RestyClient.R().Get("http://localhost:36789/api/metrics")
assert.Nil(t, err) assert.Nil(t, err)
assert.Equal(t, rest.StatusCode(), 200) assert.Equal(t, rest.StatusCode(), 200)
Loading…
Cancel
Save