This commit is contained in:
Michał Matczuk 2017-09-27 22:33:21 +02:00
parent 262f210796
commit 342b0b5f81
9 changed files with 10 additions and 10 deletions

View file

@ -19,7 +19,7 @@ check: .check-fmt .check-vet .check-lint .check-misspell .check-ineffassign
.check-lint: .check-lint:
@golint `go list ./...` \ @golint `go list ./...` \
| grep -v /id/ \ | grep -v /id/ \
| grep -v /mock/ \ | grep -v /tunnelmock/ \
| tee /dev/stderr | ifne false | tee /dev/stderr | ifne false
.PHONY: .check-misspell .PHONY: .check-misspell

View file

@ -13,8 +13,8 @@ import (
"time" "time"
"github.com/golang/mock/gomock" "github.com/golang/mock/gomock"
"github.com/mmatczuk/go-http-tunnel/mock"
"github.com/mmatczuk/go-http-tunnel/proto" "github.com/mmatczuk/go-http-tunnel/proto"
"github.com/mmatczuk/go-http-tunnel/tunnelmock"
) )
func TestClient_Dial(t *testing.T) { func TestClient_Dial(t *testing.T) {
@ -48,7 +48,7 @@ func TestClient_DialBackoff(t *testing.T) {
ctrl := gomock.NewController(t) ctrl := gomock.NewController(t)
defer ctrl.Finish() defer ctrl.Finish()
b := mock.NewMockBackoff(ctrl) b := tunnelmock.NewMockBackoff(ctrl)
gomock.InOrder( gomock.InOrder(
b.EXPECT().NextBackOff().Return(50*time.Millisecond).Times(2), b.EXPECT().NextBackOff().Return(50*time.Millisecond).Times(2),
b.EXPECT().NextBackOff().Return(-time.Millisecond), b.EXPECT().NextBackOff().Return(-time.Millisecond),

View file

@ -301,7 +301,7 @@ func port(addr net.Addr) string {
} }
func selfSignedCert() (tls.Certificate, id.ID) { func selfSignedCert() (tls.Certificate, id.ID) {
cert, err := tls.LoadX509KeyPair("./test-fixtures/selfsigned.crt", "./test-fixtures/selfsigned.key") cert, err := tls.LoadX509KeyPair("./testdata/selfsigned.crt", "./testdata/selfsigned.key")
if err != nil { if err != nil {
panic(err) panic(err)
} }

View file

@ -8,7 +8,7 @@ import (
"testing" "testing"
"github.com/golang/mock/gomock" "github.com/golang/mock/gomock"
"github.com/mmatczuk/go-http-tunnel/mock" "github.com/mmatczuk/go-http-tunnel/tunnelmock"
) )
func TestFilterLogger_Log(t *testing.T) { func TestFilterLogger_Log(t *testing.T) {
@ -17,7 +17,7 @@ func TestFilterLogger_Log(t *testing.T) {
ctrl := gomock.NewController(t) ctrl := gomock.NewController(t)
defer ctrl.Finish() defer ctrl.Finish()
b := mock.NewMockLogger(ctrl) b := tunnelmock.NewMockLogger(ctrl)
f := NewFilterLogger(b, 2) f := NewFilterLogger(b, 2)
b.EXPECT().Log("level", 0) b.EXPECT().Log("level", 0)
f.Log("level", 0) f.Log("level", 0)

View file

@ -8,7 +8,7 @@ import (
"testing" "testing"
"github.com/golang/mock/gomock" "github.com/golang/mock/gomock"
"github.com/mmatczuk/go-http-tunnel/mock" "github.com/mmatczuk/go-http-tunnel/tunnelmock"
) )
func TestContext_Log(t *testing.T) { func TestContext_Log(t *testing.T) {
@ -17,7 +17,7 @@ func TestContext_Log(t *testing.T) {
ctrl := gomock.NewController(t) ctrl := gomock.NewController(t)
defer ctrl.Finish() defer ctrl.Finish()
b := mock.NewMockLogger(ctrl) b := tunnelmock.NewMockLogger(ctrl)
b.EXPECT().Log("key", "val", "sufix", "") b.EXPECT().Log("key", "val", "sufix", "")
NewContext(b).With("sufix", "").Log("key", "val") NewContext(b).With("sufix", "").Log("key", "val")

View file

@ -5,7 +5,7 @@
// Automatically generated by MockGen. DO NOT EDIT! // Automatically generated by MockGen. DO NOT EDIT!
// Source: github.com/mmatczuk/go-http-tunnel (interfaces: Backoff) // Source: github.com/mmatczuk/go-http-tunnel (interfaces: Backoff)
package mock package tunnelmock
import ( import (
gomock "github.com/golang/mock/gomock" gomock "github.com/golang/mock/gomock"

View file

@ -5,7 +5,7 @@
// Automatically generated by MockGen. DO NOT EDIT! // Automatically generated by MockGen. DO NOT EDIT!
// Source: github.com/mmatczuk/go-http-tunnel/log (interfaces: Logger) // Source: github.com/mmatczuk/go-http-tunnel/log (interfaces: Logger)
package mock package tunnelmock
import ( import (
gomock "github.com/golang/mock/gomock" gomock "github.com/golang/mock/gomock"