MCPcopy Index your code
hub / github.com/rclone/rclone / TestSyncDoesntUpdateModtime

Function TestSyncDoesntUpdateModtime

fs/sync/sync_test.go:1068–1092  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

1066}
1067
1068func TestSyncDoesntUpdateModtime(t *testing.T) {
1069 ctx := context.Background()
1070 r := fstest.NewRun(t)
1071 if fs.GetModifyWindow(ctx, r.Fremote) == fs.ModTimeNotSupported {
1072 t.Skip("Can't run this test on fs which doesn't support mod time")
1073 }
1074
1075 file1 := r.WriteFile("foo", "foo", t2)
1076 file2 := r.WriteObject(ctx, "foo", "bar", t1)
1077
1078 r.CheckLocalItems(t, file1)
1079 r.CheckRemoteItems(t, file2)
1080
1081 accounting.GlobalStats().ResetCounters()
1082 ctx = predictDstFromLogger(ctx)
1083 err := Sync(ctx, r.Fremote, r.Flocal, false)
1084 require.NoError(t, err)
1085 testLoggerVsLsf(ctx, r.Fremote, r.Flocal, operations.GetLoggerOpt(ctx).JSON, t)
1086
1087 r.CheckLocalItems(t, file1)
1088 r.CheckRemoteItems(t, file1)
1089
1090 // We should have transferred exactly one file, not set the mod time
1091 assert.Equal(t, toyFileTransfers(r), accounting.GlobalStats().GetTransfers())
1092}
1093
1094func TestSyncAfterAddingAFile(t *testing.T) {
1095 ctx := context.Background()

Callers

nothing calls this directly

Calls 15

WriteFileMethod · 0.95
WriteObjectMethod · 0.95
CheckLocalItemsMethod · 0.95
CheckRemoteItemsMethod · 0.95
NewRunFunction · 0.92
GetModifyWindowFunction · 0.92
GlobalStatsFunction · 0.92
GetLoggerOptFunction · 0.92
predictDstFromLoggerFunction · 0.85
SyncFunction · 0.85
testLoggerVsLsfFunction · 0.85
toyFileTransfersFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…