Skip to content
Permalink
Browse files

Merge pull request #9 from appleboy/improve

fix: improve coverage
  • Loading branch information...
Depado committed Aug 19, 2019
2 parents 59c6ef6 + 60eac35 commit ce3affe17b932d176c6f6c09d5e05bb75904c055
Showing with 12 additions and 250 deletions.
  1. +0 −201 Gopkg.lock
  2. +0 −46 Gopkg.toml
  3. +1 −1 go.mod
  4. +2 −2 go.sum
  5. +9 −0 prom_test.go

This file was deleted.

This file was deleted.

2 go.mod
@@ -1,7 +1,7 @@
module github.com/Depado/ginprom

require (
github.com/appleboy/gofight/v2 v2.0.0+incompatible
github.com/appleboy/gofight/v2 v2.1.1
github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/gin-gonic/gin v1.4.0
4 go.sum
@@ -1,6 +1,6 @@
github.com/Knetic/govaluate v3.0.0+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0=
github.com/appleboy/gofight/v2 v2.0.0+incompatible h1:mfTmEhmo9BZnzAtFpRL8MEkAxuWEzfJ3Gpgn6Zuzgw4=
github.com/appleboy/gofight/v2 v2.0.0+incompatible/go.mod h1:6E7pthKhmwss84j/zEixBNim8Q6ahhHcYOtmW5ts5vA=
github.com/appleboy/gofight/v2 v2.1.1 h1:mBiMmXAofKf1GdEHxp8QkfrRaj/nBCoDnkwjn8axsq8=
github.com/appleboy/gofight/v2 v2.1.1/go.mod h1:6E7pthKhmwss84j/zEixBNim8Q6ahhHcYOtmW5ts5vA=
github.com/astaxie/beego v1.11.1/go.mod h1:i69hVzgauOPSw5qeyF4GVZhn7Od0yG5bbCGzmhbWxgQ=
github.com/beego/goyaml2 v0.0.0-20130207012346-5545475820dd/go.mod h1:1b+Y/CofkYwXMUU0OhQqGvsY2Bvgr4j6jfT699wyZKQ=
github.com/beego/x2j v0.0.0-20131220205130-a0352aadc542/go.mod h1:kSeGC/p1AbBiEp5kat81+DSQrZenVBZXklMLaELspWU=
@@ -246,6 +246,15 @@ func TestMetricsBearerToken(t *testing.T) {
assert.Equal(t, errInvalidToken.Error(), r.Body.String())
})

g.GET(p.MetricsPath).
SetHeader(gofight.H{
"Authorization": "Bearer " + "test-1234-5678",
}).
Run(r, func(r gofight.HTTPResponse, rq gofight.HTTPRequest) {
assert.Equal(t, http.StatusUnauthorized, r.Code)
assert.Equal(t, errInvalidToken.Error(), r.Body.String())
})

g.GET(p.MetricsPath).
SetHeader(gofight.H{
"Authorization": "Bearer " + "test-1234",

0 comments on commit ce3affe

Please sign in to comment.
You can’t perform that action at this time.