Browse Source

Review comments

kegan/tests-prep
Kegan Dougal 8 years ago
parent
commit
352d741558
  1. 2
      hooks/pre-commit
  2. 6
      src/github.com/matrix-org/go-neb/goneb_services_test.go

2
hooks/pre-commit

@ -6,4 +6,4 @@ golint src/...
go fmt ./src/... go fmt ./src/...
go tool vet --shadow ./src go tool vet --shadow ./src
gocyclo -over 12 src/ gocyclo -over 12 src/
gb test
gb test -timeout 5s

6
src/github.com/matrix-org/go-neb/goneb_services_test.go

@ -2,10 +2,10 @@ package main
import ( import (
"bytes" "bytes"
"fmt"
"net/http" "net/http"
"net/http/httptest" "net/http/httptest"
"os" "os"
"strconv"
"testing" "testing"
) )
@ -20,8 +20,8 @@ func (rt MockTripper) RoundTrip(req *http.Request) (*http.Response, error) {
h := rt.handlers[key] h := rt.handlers[key]
if h == nil { if h == nil {
panic( panic(
"Test RoundTrip: Unhandled request: " + key + "\n" +
"Handlers: " + strconv.Itoa(len(rt.handlers)),
fmt.Sprintf("Test RoundTrip: Unhandled request: %s\nHandlers: %d",
key, len(rt.handlers)),
) )
} }
return h(req) return h(req)

Loading…
Cancel
Save