MCPcopy
hub / github.com/syncthing/syncthing / TestAutoAcceptNewFolderFromTwoDevices

Function TestAutoAcceptNewFolderFromTwoDevices

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

Source from the content-addressed store, hash-verified

1045}
1046
1047func TestAutoAcceptNewFolderFromTwoDevices(t *testing.T) {
1048 m, cancel := newState(t, defaultAutoAcceptCfg)
1049 defer cleanupModel(m)
1050 defer cancel()
1051 id := srand.String(8)
1052 defer os.RemoveAll(id)
1053 m.ClusterConfig(device1Conn, createClusterConfig(device1, id))
1054 if fcfg, ok := m.cfg.Folder(id); !ok || !fcfg.SharedWith(device1) {
1055 t.Error("expected shared", id)
1056 }
1057 if fcfg, ok := m.cfg.Folder(id); !ok || fcfg.SharedWith(device2) {
1058 t.Error("unexpected expected shared", id)
1059 }
1060 m.ClusterConfig(device2Conn, createClusterConfig(device2, id))
1061 if fcfg, ok := m.cfg.Folder(id); !ok || !fcfg.SharedWith(device2) {
1062 t.Error("expected shared", id)
1063 }
1064}
1065
1066func TestAutoAcceptNewFolderFromOnlyOneDevice(t *testing.T) {
1067 modifiedCfg := defaultAutoAcceptCfg.Copy()

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