2016-09-07 03:04:16 -05:00
|
|
|
package imguploader
|
|
|
|
|
|
|
|
import (
|
2017-09-15 08:46:41 -05:00
|
|
|
"context"
|
2016-09-07 03:04:16 -05:00
|
|
|
"testing"
|
|
|
|
|
|
|
|
"github.com/grafana/grafana/pkg/setting"
|
|
|
|
. "github.com/smartystreets/goconvey/convey"
|
|
|
|
)
|
|
|
|
|
|
|
|
func TestUploadToS3(t *testing.T) {
|
2017-04-25 10:20:03 -05:00
|
|
|
SkipConvey("[Integration test] for external_image_store.s3", t, func() {
|
2018-04-30 09:21:04 -05:00
|
|
|
cfg := setting.NewCfg()
|
|
|
|
cfg.Load(&setting.CommandLineArgs{
|
2016-09-07 03:04:16 -05:00
|
|
|
HomePath: "../../../",
|
|
|
|
})
|
|
|
|
|
|
|
|
s3Uploader, _ := NewImageUploader()
|
|
|
|
|
2017-09-15 08:46:41 -05:00
|
|
|
path, err := s3Uploader.Upload(context.Background(), "../../../public/img/logo_transparent_400x.png")
|
2016-09-07 03:04:16 -05:00
|
|
|
|
|
|
|
So(err, ShouldBeNil)
|
|
|
|
So(path, ShouldNotEqual, "")
|
|
|
|
})
|
|
|
|
}
|