MCPcopy
hub / github.com/syncthing/syncthing / TestAutoAcceptAlreadyShared

Function TestAutoAcceptAlreadyShared

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

Source from the content-addressed store, hash-verified

1196}
1197
1198func TestAutoAcceptAlreadyShared(t *testing.T) {
1199 // Already shared
1200 id := srand.String(8)
1201 tcfg := defaultAutoAcceptCfg.Copy()
1202 tcfg.Folders = []config.FolderConfiguration{
1203 {
1204 FilesystemType: config.FilesystemTypeFake,
1205 ID: id,
1206 Path: id,
1207 Devices: []config.FolderDeviceConfiguration{
1208 {
1209 DeviceID: device1,
1210 },
1211 },
1212 },
1213 }
1214 m, cancel := newState(t, tcfg)
1215 defer cleanupModel(m)
1216 defer cancel()
1217 if fcfg, ok := m.cfg.Folder(id); !ok || !fcfg.SharedWith(device1) {
1218 t.Error("missing folder, or not shared", id)
1219 }
1220 m.ClusterConfig(device1Conn, createClusterConfig(device1, id))
1221
1222 if fcfg, ok := m.cfg.Folder(id); !ok || !fcfg.SharedWith(device1) {
1223 t.Error("missing folder, or not shared", id)
1224 }
1225}
1226
1227func TestAutoAcceptNameConflict(t *testing.T) {
1228 ffs := fs.NewFilesystem(fs.FilesystemTypeFake, srand.String(32))

Callers

nothing calls this directly

Calls 9

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

Tested by

no test coverage detected