mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
parent
8ba5509614
commit
9843a886f7
@ -9,6 +9,7 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
|
|
||||||
. "github.com/smartystreets/goconvey/convey"
|
. "github.com/smartystreets/goconvey/convey"
|
||||||
|
"github.com/stretchr/testify/require"
|
||||||
|
|
||||||
"github.com/grafana/grafana/pkg/components/simplejson"
|
"github.com/grafana/grafana/pkg/components/simplejson"
|
||||||
"github.com/grafana/grafana/pkg/setting"
|
"github.com/grafana/grafana/pkg/setting"
|
||||||
@ -201,11 +202,14 @@ func TestDataSourceCache(t *testing.T) {
|
|||||||
// Can't use So() here, see: https://github.com/smartystreets/goconvey/issues/561
|
// Can't use So() here, see: https://github.com/smartystreets/goconvey/issues/561
|
||||||
if r.Header.Get("Authorization") == "Bearer xf5yhfkpsnmgo" {
|
if r.Header.Get("Authorization") == "Bearer xf5yhfkpsnmgo" {
|
||||||
w.WriteHeader(200)
|
w.WriteHeader(200)
|
||||||
w.Write([]byte("Ok"))
|
_, err := w.Write([]byte("Ok"))
|
||||||
|
require.Nil(t, err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
w.WriteHeader(403)
|
w.WriteHeader(403)
|
||||||
w.Write([]byte("Invalid bearer token provided"))
|
_, err := w.Write([]byte("Invalid bearer token provided"))
|
||||||
|
require.Nil(t, err)
|
||||||
}))
|
}))
|
||||||
defer backend.Close()
|
defer backend.Close()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user