mirror of
https://github.com/anyproto/any-sync.git
synced 2025-06-08 14:07:02 +09:00
Fix test
This commit is contained in:
parent
b3d3b3ea92
commit
fd27cf8650
1 changed files with 24 additions and 0 deletions
|
@ -38,6 +38,7 @@ import (
|
|||
"github.com/anyproto/any-sync/net/rpc/rpctest"
|
||||
"github.com/anyproto/any-sync/net/streampool"
|
||||
"github.com/anyproto/any-sync/net/streampool/streamopener"
|
||||
"github.com/anyproto/any-sync/node/nodeclient"
|
||||
"github.com/anyproto/any-sync/nodeconf"
|
||||
"github.com/anyproto/any-sync/testutil/accounttest"
|
||||
"github.com/anyproto/any-sync/util/crypto"
|
||||
|
@ -150,6 +151,27 @@ func (m *mockConf) NodeTypes(nodeId string) []nodeconf.NodeType {
|
|||
return nil
|
||||
}
|
||||
|
||||
var _ nodeclient.NodeClient = (*mockNodeClient)(nil)
|
||||
|
||||
type mockNodeClient struct {
|
||||
}
|
||||
|
||||
func (m mockNodeClient) Init(a *app.App) (err error) {
|
||||
return
|
||||
}
|
||||
|
||||
func (m mockNodeClient) Name() (name string) {
|
||||
return nodeclient.CName
|
||||
}
|
||||
|
||||
func (m mockNodeClient) AclGetRecords(ctx context.Context, spaceId, aclHead string) (recs []*consensusproto.RawRecordWithId, err error) {
|
||||
return
|
||||
}
|
||||
|
||||
func (m mockNodeClient) AclAddRecord(ctx context.Context, spaceId string, rec *consensusproto.RawRecord) (recWithId *consensusproto.RawRecordWithId, err error) {
|
||||
return
|
||||
}
|
||||
|
||||
//
|
||||
// Mock PeerManager
|
||||
//
|
||||
|
@ -615,6 +637,7 @@ func newFixture(t *testing.T) *spaceFixture {
|
|||
Register(credentialprovider.NewNoOp()).
|
||||
Register(&mockStatusServiceProvider{}).
|
||||
Register(mockCoordinatorClient{}).
|
||||
Register(mockNodeClient{}).
|
||||
Register(fx.configurationService).
|
||||
Register(fx.storageProvider).
|
||||
Register(fx.peerManagerProvider).
|
||||
|
@ -654,6 +677,7 @@ func newFixtureWithData(t *testing.T, spaceId string, keys *accountdata.AccountK
|
|||
Register(credentialprovider.NewNoOp()).
|
||||
Register(&mockStatusServiceProvider{}).
|
||||
Register(mockCoordinatorClient{}).
|
||||
Register(mockNodeClient{}).
|
||||
Register(fx.configurationService).
|
||||
Register(fx.storageProvider).
|
||||
Register(fx.peerManagerProvider).
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue