MCPcopy
hub / github.com/syncthing/syncthing / TestAutoAcceptMultipleFolders

Function TestAutoAcceptMultipleFolders

lib/model/model_test.go:1126–1142  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

1124}
1125
1126func TestAutoAcceptMultipleFolders(t *testing.T) {
1127 // Multiple new folders
1128 id1 := srand.String(8)
1129 defer os.RemoveAll(id1)
1130 id2 := srand.String(8)
1131 defer os.RemoveAll(id2)
1132 m, cancel := newState(t, defaultAutoAcceptCfg)
1133 defer cleanupModel(m)
1134 defer cancel()
1135 m.ClusterConfig(device1Conn, createClusterConfig(device1, id1, id2))
1136 if fcfg, ok := m.cfg.Folder(id1); !ok || !fcfg.SharedWith(device1) {
1137 t.Error("expected shared", id1)
1138 }
1139 if fcfg, ok := m.cfg.Folder(id2); !ok || !fcfg.SharedWith(device1) {
1140 t.Error("expected shared", id2)
1141 }
1142}
1143
1144func TestAutoAcceptExistingFolder(t *testing.T) {
1145 // Existing folder

Callers

nothing calls this directly

Calls 9

newStateFunction · 0.85
cleanupModelFunction · 0.85
createClusterConfigFunction · 0.85
SharedWithMethod · 0.80
StringMethod · 0.65
RemoveAllMethod · 0.65
ClusterConfigMethod · 0.65
FolderMethod · 0.65
ErrorMethod · 0.65

Tested by

no test coverage detected