MCPcopy
hub / github.com/syncthing/syncthing / TestIssue4897

Function TestIssue4897

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

Source from the content-addressed store, hash-verified

939}
940
941func TestIssue4897(t *testing.T) {
942 m, cancel := newState(t, config.Configuration{
943 Version: config.CurrentVersion,
944 Devices: []config.DeviceConfiguration{
945 {
946 DeviceID: device1,
947 Introducer: true,
948 },
949 },
950 Folders: []config.FolderConfiguration{
951 {
952 FilesystemType: config.FilesystemTypeFake,
953 ID: "folder1",
954 Path: "testdata",
955 Devices: []config.FolderDeviceConfiguration{
956 {DeviceID: device1},
957 },
958 Paused: true,
959 },
960 },
961 })
962 defer cleanupModel(m)
963 cancel()
964
965 cm, _ := m.generateClusterConfig(device1)
966 if l := len(cm.Folders); l != 1 {
967 t.Errorf("Cluster config contains %v folders, expected 1", l)
968 }
969}
970
971// TestIssue5063 is about a panic in connection with modifying config in quick
972// succession, related with auto accepted folders. It's unclear what exactly, a

Callers

nothing calls this directly

Calls 3

newStateFunction · 0.85
cleanupModelFunction · 0.85
generateClusterConfigMethod · 0.80

Tested by

no test coverage detected