MCPcopy
hub / github.com/rclone/rclone / TestSyncAfterChangingModtimeOnlyWithNoUpdateModTime

Function TestSyncAfterChangingModtimeOnlyWithNoUpdateModTime

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

Source from the content-addressed store, hash-verified

1038}
1039
1040func TestSyncAfterChangingModtimeOnlyWithNoUpdateModTime(t *testing.T) {
1041 ctx := context.Background()
1042 ctx, ci := fs.AddConfig(ctx)
1043 r := fstest.NewRun(t)
1044
1045 if r.Fremote.Hashes().Count() == 0 {
1046 t.Logf("Can't check this if no hashes supported")
1047 return
1048 }
1049
1050 ci.NoUpdateModTime = true
1051
1052 file1 := r.WriteFile("empty space", "-", t2)
1053 file2 := r.WriteObject(ctx, "empty space", "-", t1)
1054
1055 r.CheckLocalItems(t, file1)
1056 r.CheckRemoteItems(t, file2)
1057
1058 accounting.GlobalStats().ResetCounters()
1059 ctx = predictDstFromLogger(ctx)
1060 err := Sync(ctx, r.Fremote, r.Flocal, false)
1061 require.NoError(t, err)
1062 testLoggerVsLsf(ctx, r.Fremote, r.Flocal, operations.GetLoggerOpt(ctx).JSON, t)
1063
1064 r.CheckLocalItems(t, file1)
1065 r.CheckRemoteItems(t, file2)
1066}
1067
1068func TestSyncDoesntUpdateModtime(t *testing.T) {
1069 ctx := context.Background()

Callers

nothing calls this directly

Calls 15

WriteFileMethod · 0.95
WriteObjectMethod · 0.95
CheckLocalItemsMethod · 0.95
CheckRemoteItemsMethod · 0.95
AddConfigFunction · 0.92
NewRunFunction · 0.92
GlobalStatsFunction · 0.92
GetLoggerOptFunction · 0.92
predictDstFromLoggerFunction · 0.85
SyncFunction · 0.85
testLoggerVsLsfFunction · 0.85
LogfMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…