2017-07-29 21:31:28 -05:00
|
|
|
package imguploader
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
"testing"
|
|
|
|
|
|
|
|
"github.com/grafana/grafana/pkg/setting"
|
2021-07-02 06:22:47 -05:00
|
|
|
"github.com/stretchr/testify/require"
|
2017-07-29 21:31:28 -05:00
|
|
|
)
|
|
|
|
|
|
|
|
func TestUploadToAzureBlob(t *testing.T) {
|
2021-07-02 06:22:47 -05:00
|
|
|
t.Run("[Integration test] for external_image_store.azure_blob", func(t *testing.T) {
|
|
|
|
t.Skip("Skipping testing for external_image_store.azure_blob")
|
2018-04-30 09:21:04 -05:00
|
|
|
cfg := setting.NewCfg()
|
2021-08-25 08:11:22 -05:00
|
|
|
|
|
|
|
err := cfg.Load(setting.CommandLineArgs{
|
2017-07-29 21:31:28 -05:00
|
|
|
HomePath: "../../../",
|
|
|
|
})
|
2021-07-02 06:22:47 -05:00
|
|
|
require.NoError(t, err)
|
2017-07-29 21:31:28 -05:00
|
|
|
|
2024-01-23 05:36:22 -06:00
|
|
|
uploader, _ := NewImageUploader(cfg)
|
2017-07-29 21:31:28 -05:00
|
|
|
|
|
|
|
path, err := uploader.Upload(context.Background(), "../../../public/img/logo_transparent_400x.png")
|
|
|
|
|
2021-07-02 06:22:47 -05:00
|
|
|
require.NoError(t, err)
|
|
|
|
require.NotEqual(t, "", path)
|
2017-07-29 21:31:28 -05:00
|
|
|
})
|
|
|
|
}
|