mirror of
https://github.com/anyproto/any-sync.git
synced 2025-06-08 05:57:03 +09:00
fix tests
This commit is contained in:
parent
afda392d20
commit
b52aa184d6
3 changed files with 30 additions and 6 deletions
|
@ -59,6 +59,10 @@ func (p pushSpaceRequestMatcher) String() string {
|
|||
type mockPeer struct {
|
||||
}
|
||||
|
||||
func (m mockPeer) CloseChan() <-chan struct{} {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m mockPeer) SetTTL(ttl time.Duration) {
|
||||
return
|
||||
}
|
||||
|
|
|
@ -69,6 +69,20 @@ func (mr *MockPeerMockRecorder) Close() *gomock.Call {
|
|||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Close", reflect.TypeOf((*MockPeer)(nil).Close))
|
||||
}
|
||||
|
||||
// CloseChan mocks base method.
|
||||
func (m *MockPeer) CloseChan() <-chan struct{} {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "CloseChan")
|
||||
ret0, _ := ret[0].(<-chan struct{})
|
||||
return ret0
|
||||
}
|
||||
|
||||
// CloseChan indicates an expected call of CloseChan.
|
||||
func (mr *MockPeerMockRecorder) CloseChan() *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CloseChan", reflect.TypeOf((*MockPeer)(nil).CloseChan))
|
||||
}
|
||||
|
||||
// Context mocks base method.
|
||||
func (m *MockPeer) Context() context.Context {
|
||||
m.ctrl.T.Helper()
|
||||
|
|
|
@ -4,16 +4,18 @@ import (
|
|||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
net2 "net"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
"storj.io/drpc"
|
||||
|
||||
"github.com/anyproto/any-sync/app"
|
||||
"github.com/anyproto/any-sync/net"
|
||||
"github.com/anyproto/any-sync/net/peer"
|
||||
"github.com/anyproto/any-sync/net/secureservice/handshake"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
net2 "net"
|
||||
"storj.io/drpc"
|
||||
"testing"
|
||||
"time"
|
||||
)
|
||||
|
||||
var ctx = context.Background()
|
||||
|
@ -276,3 +278,7 @@ func (t *testPeer) IsClosed() bool {
|
|||
return false
|
||||
}
|
||||
}
|
||||
|
||||
func (t *testPeer) CloseChan() <-chan struct{} {
|
||||
return t.closed
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue