MCPcopy
hub / github.com/syncthing/syncthing / addDevice2

Function addDevice2

lib/model/testutils_test.go:360–368  ·  view source on GitHub ↗
(t testing.TB, w config.Wrapper, fcfg config.FolderConfiguration)

Source from the content-addressed store, hash-verified

358}
359
360func addDevice2(t testing.TB, w config.Wrapper, fcfg config.FolderConfiguration) {
361 waiter, err := w.Modify(func(cfg *config.Configuration) {
362 cfg.SetDevice(newDeviceConfiguration(cfg.Defaults.Device, device2, "device2"))
363 fcfg.Devices = append(fcfg.Devices, config.FolderDeviceConfiguration{DeviceID: device2})
364 cfg.SetFolder(fcfg)
365 })
366 must(t, err)
367 waiter.Wait()
368}
369
370func writeFile(t testing.TB, filesystem fs.Filesystem, name string, data []byte) {
371 t.Helper()

Callers 2

Calls 6

mustFunction · 0.85
SetDeviceMethod · 0.80
SetFolderMethod · 0.80
newDeviceConfigurationFunction · 0.70
ModifyMethod · 0.65
WaitMethod · 0.65

Tested by

no test coverage detected