token_client_test.go 607 B

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