Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nexpie-grafana-theme
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kornkitt Poolsup
nexpie-grafana-theme
Commits
0d083bad
Commit
0d083bad
authored
Sep 07, 2016
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of github.com:grafana/grafana
Conflicts: pkg/components/imguploader/s3uploader.go
parents
50b41130
d1a7a23c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
35 additions
and
5 deletions
+35
-5
pkg/components/imguploader/imguploader_test.go
+12
-3
pkg/components/imguploader/s3uploader_test.go
+23
-0
pkg/components/imguploader/webdavuploader.go
+0
-2
No files found.
pkg/components/imguploader/imguploader_test.go
View file @
0d083bad
package
imguploader
import
(
"reflect"
"testing"
"github.com/grafana/grafana/pkg/setting"
...
...
@@ -27,7 +26,12 @@ func TestImageUploaderFactory(t *testing.T) {
uploader
,
err
:=
NewImageUploader
()
So
(
err
,
ShouldBeNil
)
So
(
reflect
.
TypeOf
(
uploader
),
ShouldEqual
,
reflect
.
TypeOf
(
&
S3Uploader
{}))
original
,
ok
:=
uploader
.
(
*
S3Uploader
)
So
(
ok
,
ShouldBeTrue
)
So
(
original
.
accessKey
,
ShouldEqual
,
"access_key"
)
So
(
original
.
secretKey
,
ShouldEqual
,
"secret_key"
)
So
(
original
.
bucket
,
ShouldEqual
,
"bucket_url"
)
})
Convey
(
"Webdav uploader"
,
func
()
{
...
...
@@ -47,7 +51,12 @@ func TestImageUploaderFactory(t *testing.T) {
uploader
,
err
:=
NewImageUploader
()
So
(
err
,
ShouldBeNil
)
So
(
reflect
.
TypeOf
(
uploader
),
ShouldEqual
,
reflect
.
TypeOf
(
&
WebdavUploader
{}))
original
,
ok
:=
uploader
.
(
*
WebdavUploader
)
So
(
ok
,
ShouldBeTrue
)
So
(
original
.
url
,
ShouldEqual
,
"webdavUrl"
)
So
(
original
.
username
,
ShouldEqual
,
"username"
)
So
(
original
.
password
,
ShouldEqual
,
"password"
)
})
})
}
pkg/components/imguploader/s3uploader_test.go
0 → 100644
View file @
0d083bad
package
imguploader
import
(
"testing"
"github.com/grafana/grafana/pkg/setting"
.
"github.com/smartystreets/goconvey/convey"
)
func
TestUploadToS3
(
t
*
testing
.
T
)
{
SkipConvey
(
"[Integration test] for external_image_store.webdav"
,
t
,
func
()
{
setting
.
NewConfigContext
(
&
setting
.
CommandLineArgs
{
HomePath
:
"../../../"
,
})
s3Uploader
,
_
:=
NewImageUploader
()
path
,
err
:=
s3Uploader
.
Upload
(
"../../../public/img/logo_transparent_400x.png"
)
So
(
err
,
ShouldBeNil
)
So
(
path
,
ShouldNotEqual
,
""
)
})
}
pkg/components/imguploader/webdavuploader.go
View file @
0d083bad
...
...
@@ -9,7 +9,6 @@ import (
"path"
"time"
"github.com/grafana/grafana/pkg/log"
"github.com/grafana/grafana/pkg/util"
)
...
...
@@ -20,7 +19,6 @@ type WebdavUploader struct {
}
func
(
u
*
WebdavUploader
)
Upload
(
pa
string
)
(
string
,
error
)
{
log
.
Error2
(
"Hej"
)
client
:=
http
.
Client
{
Timeout
:
time
.
Duration
(
10
*
time
.
Second
)}
url
,
_
:=
url
.
Parse
(
u
.
url
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment