(t *testing.T)
| 1064 | } |
| 1065 | |
| 1066 | func 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 | |
| 1087 | func TestAutoAcceptNewFolderPremutationsNoPanic(t *testing.T) { |
| 1088 | if testing.Short() { |
nothing calls this directly
no test coverage detected