MCPcopy
hub / github.com/syncthing/syncthing / TestIssue4903

Function TestIssue4903

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

Source from the content-addressed store, hash-verified

2825}
2826
2827func TestIssue4903(t *testing.T) {
2828 wrapper, cancel := newConfigWrapper(config.Configuration{Version: config.CurrentVersion})
2829 defer cancel()
2830 m := setupModel(t, wrapper)
2831 defer cleanupModel(m)
2832
2833 // Force the model to wire itself and add the folders
2834 folderPath := "nonexistent"
2835 cfg := defaultCfgWrapper.RawCopy()
2836 fcfg := config.FolderConfiguration{
2837 ID: "folder1",
2838 Path: folderPath,
2839 FilesystemType: config.FilesystemTypeBasic,
2840 Paused: true,
2841 Devices: []config.FolderDeviceConfiguration{
2842 {DeviceID: device1},
2843 },
2844 }
2845 cfg.Folders = []config.FolderConfiguration{fcfg}
2846 replace(t, wrapper, cfg)
2847
2848 if err := fcfg.CheckPath(); err != config.ErrPathMissing {
2849 t.Fatalf("expected path missing error, got: %v, debug: %s", err, fcfg.CheckPath())
2850 }
2851
2852 if _, err := fcfg.Filesystem().Lstat("."); !fs.IsNotExist(err) {
2853 t.Fatalf("Expected missing path error, got: %v", err)
2854 }
2855}
2856
2857func TestIssue5002(t *testing.T) {
2858 // recheckFile should not panic when given an index equal to the number of blocks

Callers

nothing calls this directly

Calls 9

CheckPathMethod · 0.95
FilesystemMethod · 0.95
IsNotExistFunction · 0.92
newConfigWrapperFunction · 0.85
setupModelFunction · 0.85
cleanupModelFunction · 0.85
replaceFunction · 0.70
RawCopyMethod · 0.65
LstatMethod · 0.65

Tested by

no test coverage detected