mirror of
https://github.com/anyproto/any-sync.git
synced 2025-06-08 05:57:03 +09:00
Fix settings and deletion tests
This commit is contained in:
parent
564c636391
commit
51eb5b1a42
7 changed files with 21 additions and 227 deletions
|
@ -270,6 +270,7 @@ type mockTreeManager struct {
|
|||
cache ocache.OCache
|
||||
deletedIds []string
|
||||
markedIds []string
|
||||
waitLoad chan struct{}
|
||||
}
|
||||
|
||||
func (t *mockTreeManager) NewTreeSyncer(spaceId string, treeManager treemanager.TreeManager) treemanager.TreeSyncer {
|
||||
|
@ -283,6 +284,7 @@ func (t *mockTreeManager) MarkTreeDeleted(ctx context.Context, spaceId, treeId s
|
|||
|
||||
func (t *mockTreeManager) Init(a *app.App) (err error) {
|
||||
t.cache = ocache.New(func(ctx context.Context, id string) (value ocache.Object, err error) {
|
||||
<-t.waitLoad
|
||||
return t.space.TreeBuilder().BuildTree(ctx, id, objecttreebuilder.BuildTreeOpts{})
|
||||
},
|
||||
ocache.WithGCPeriod(time.Minute),
|
||||
|
@ -352,7 +354,7 @@ func newFixture(t *testing.T) *spaceFixture {
|
|||
configurationService: &mockConf{},
|
||||
storageProvider: spacestorage.NewInMemorySpaceStorageProvider(),
|
||||
peermanagerProvider: &mockPeerManagerProvider{},
|
||||
treeManager: &mockTreeManager{},
|
||||
treeManager: &mockTreeManager{waitLoad: make(chan struct{})},
|
||||
pool: &mockPool{},
|
||||
spaceService: New(),
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue