token_client_test.go 574 B

123456789101112131415161718192021222324252627
  1. package mqe
  2. import (
  3. "context"
  4. "testing"
  5. "github.com/grafana/grafana/pkg/components/simplejson"
  6. "github.com/grafana/grafana/pkg/models"
  7. . "github.com/smartystreets/goconvey/convey"
  8. )
  9. func TestTokenClient(t *testing.T) {
  10. SkipConvey("Token client", t, func() {
  11. dsInfo := &models.DataSource{
  12. JsonData: simplejson.New(),
  13. Url: "",
  14. }
  15. client := NewTokenClient(dsInfo)
  16. body, err := client.RequestTokenData(context.TODO())
  17. So(err, ShouldBeNil)
  18. //So(len(body.Functions), ShouldBeGreaterThan, 1)
  19. So(len(body.Metrics), ShouldBeGreaterThan, 1)
  20. })
  21. }