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
fbc3c3dd
Commit
fbc3c3dd
authored
Feb 08, 2017
by
Daniel Lee
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
api: removes import alias + some unused fields
parent
8aa5b62d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
16 deletions
+5
-16
pkg/api/datasources_test.go
+5
-16
No files found.
pkg/api/datasources_test.go
View file @
fbc3c3dd
...
...
@@ -7,7 +7,7 @@ import (
"path/filepath"
"testing"
m
"github.com/grafana/grafana/pkg/models"
"github.com/grafana/grafana/pkg/models"
macaron
"gopkg.in/macaron.v1"
"github.com/go-macaron/session"
...
...
@@ -26,9 +26,9 @@ func TestDataSourcesProxy(t *testing.T) {
loggedInUserScenario
(
"When calling GET on"
,
"/api/datasources/"
,
func
(
sc
*
scenarioContext
)
{
// Stubs the database query
bus
.
AddHandler
(
"test"
,
func
(
query
*
m
.
GetDataSourcesQuery
)
error
{
bus
.
AddHandler
(
"test"
,
func
(
query
*
m
odels
.
GetDataSourcesQuery
)
error
{
So
(
query
.
OrgId
,
ShouldEqual
,
TestOrgID
)
query
.
Result
=
[]
*
m
.
DataSource
{
query
.
Result
=
[]
*
m
odels
.
DataSource
{
{
Name
:
"mmm"
},
{
Name
:
"ZZZ"
},
{
Name
:
"BBB"
},
...
...
@@ -75,7 +75,7 @@ func loggedInUserScenario(desc string, url string, fn scenarioFunc) {
sc
.
context
=
c
sc
.
context
.
UserId
=
TestUserID
sc
.
context
.
OrgId
=
TestOrgID
sc
.
context
.
OrgRole
=
m
.
ROLE_EDITOR
sc
.
context
.
OrgRole
=
m
odels
.
ROLE_EDITOR
if
sc
.
handlerFunc
!=
nil
{
sc
.
handlerFunc
(
sc
.
context
)
}
...
...
@@ -100,23 +100,12 @@ type scenarioContext struct {
m
*
macaron
.
Macaron
context
*
middleware
.
Context
resp
*
httptest
.
ResponseRecorder
apiKey
string
authHeader
string
handlerFunc
handlerFunc
defaultHandler
macaron
.
Handler
req
*
http
.
Request
req
*
http
.
Request
}
func
(
sc
*
scenarioContext
)
exec
()
{
if
sc
.
apiKey
!=
""
{
sc
.
req
.
Header
.
Add
(
"Authorization"
,
"Bearer "
+
sc
.
apiKey
)
}
if
sc
.
authHeader
!=
""
{
sc
.
req
.
Header
.
Add
(
"Authorization"
,
sc
.
authHeader
)
}
sc
.
m
.
ServeHTTP
(
sc
.
resp
,
sc
.
req
)
}
...
...
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