MCPcopy
hub / github.com/syncthing/syncthing / TestAutoAcceptNewFolderFromOnlyOneDevice

Function TestAutoAcceptNewFolderFromOnlyOneDevice

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

Source from the content-addressed store, hash-verified

1064}
1065
1066func TestAutoAcceptNewFolderFromOnlyOneDevice(t *testing.T) {
1067 modifiedCfg := defaultAutoAcceptCfg.Copy()
1068 modifiedCfg.Devices[2].AutoAcceptFolders = false
1069 m, cancel := newState(t, modifiedCfg)
1070 id := srand.String(8)
1071 defer os.RemoveAll(id)
1072 defer cleanupModel(m)
1073 defer cancel()
1074 m.ClusterConfig(device1Conn, createClusterConfig(device1, id))
1075 if fcfg, ok := m.cfg.Folder(id); !ok || !fcfg.SharedWith(device1) {
1076 t.Error("expected shared", id)
1077 }
1078 if fcfg, ok := m.cfg.Folder(id); !ok || fcfg.SharedWith(device2) {
1079 t.Error("unexpected expected shared", id)
1080 }
1081 m.ClusterConfig(device2Conn, createClusterConfig(device2, id))
1082 if fcfg, ok := m.cfg.Folder(id); !ok || fcfg.SharedWith(device2) {
1083 t.Error("unexpected shared", id)
1084 }
1085}
1086
1087func TestAutoAcceptNewFolderPremutationsNoPanic(t *testing.T) {
1088 if testing.Short() {

Callers

nothing calls this directly

Calls 10

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
CopyMethod · 0.45

Tested by

no test coverage detected