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