grafana/pkg/components/imguploader/gcsuploader_test.go

27 lines
587 B
Go
Raw Normal View History

2017-08-04 16:46:26 -05:00
package imguploader
import (
2017-09-15 08:46:41 -05:00
"context"
2017-08-04 16:46:26 -05:00
"testing"
"github.com/grafana/grafana/pkg/setting"
. "github.com/smartystreets/goconvey/convey"
)
2017-08-06 10:04:38 -05:00
func TestUploadToGCS(t *testing.T) {
SkipConvey("[Integration test] for external_image_store.gcs", t, func() {
cfg := setting.NewCfg()
err := cfg.Load(&setting.CommandLineArgs{
2017-08-04 16:46:26 -05:00
HomePath: "../../../",
})
So(err, ShouldBeNil)
2017-08-04 16:46:26 -05:00
2017-08-06 10:04:38 -05:00
gcsUploader, _ := NewImageUploader()
2017-08-04 16:46:26 -05:00
2017-09-15 08:46:41 -05:00
path, err := gcsUploader.Upload(context.Background(), "../../../public/img/logo_transparent_400x.png")
2017-08-04 16:46:26 -05:00
So(err, ShouldBeNil)
So(path, ShouldNotEqual, "")
})
}