(t *testing.T)
| 1142 | } |
| 1143 | |
| 1144 | func TestAutoAcceptExistingFolder(t *testing.T) { |
| 1145 | // Existing folder |
| 1146 | id := srand.String(8) |
| 1147 | idOther := srand.String(8) // To check that path does not get changed. |
| 1148 | |
| 1149 | tcfg := defaultAutoAcceptCfg.Copy() |
| 1150 | tcfg.Folders = []config.FolderConfiguration{ |
| 1151 | { |
| 1152 | FilesystemType: config.FilesystemTypeFake, |
| 1153 | ID: id, |
| 1154 | Path: idOther, // To check that path does not get changed. |
| 1155 | }, |
| 1156 | } |
| 1157 | m, cancel := newState(t, tcfg) |
| 1158 | defer cleanupModel(m) |
| 1159 | defer cancel() |
| 1160 | if fcfg, ok := m.cfg.Folder(id); !ok || fcfg.SharedWith(device1) { |
| 1161 | t.Error("missing folder, or shared", id) |
| 1162 | } |
| 1163 | m.ClusterConfig(device1Conn, createClusterConfig(device1, id)) |
| 1164 | |
| 1165 | if fcfg, ok := m.cfg.Folder(id); !ok || !fcfg.SharedWith(device1) || fcfg.Path != idOther { |
| 1166 | t.Error("missing folder, or unshared, or path changed", id) |
| 1167 | } |
| 1168 | } |
| 1169 | |
| 1170 | func TestAutoAcceptNewAndExistingFolder(t *testing.T) { |
| 1171 | // New and existing folder |
nothing calls this directly
no test coverage detected