1
0
Fork 0
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:
Sergey Cherepanov 2023-12-22 17:36:51 +01:00
parent afda392d20
commit b52aa184d6
No known key found for this signature in database
GPG key ID: 87F8EDE8FBDF637C
3 changed files with 30 additions and 6 deletions

View file

@ -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
}

View file

@ -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()

View file

@ -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
}