MCPcopy Create free account
hub / github.com/dropbox/dbxcli / TestDropboxClientModifiedUsesUTCSecondPrecision

Function TestDropboxClientModifiedUsesUTCSecondPrecision

cmd/put_test.go:1121–1137  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

1119}
1120
1121func TestDropboxClientModifiedUsesUTCSecondPrecision(t *testing.T) {
1122 input := time.Date(2026, 7, 1, 12, 34, 56, 600*1e6, time.FixedZone("source", -7*60*60))
1123
1124 got := dropboxClientModified(input)
1125 if got == nil {
1126 t.Fatal("dropboxClientModified returned nil")
1127 }
1128
1129 gotTime := time.Time(*got)
1130 want := input.UTC().Round(time.Second)
1131 if !gotTime.Equal(want) {
1132 t.Fatalf("client modified = %s, want %s", gotTime.Format(time.RFC3339Nano), want.Format(time.RFC3339Nano))
1133 }
1134 if gotTime.Location() != time.UTC {
1135 t.Fatalf("client modified location = %v, want UTC", gotTime.Location())
1136 }
1137}
1138
1139func TestPutFileUsesSourceModifiedTime(t *testing.T) {
1140 tmpFile := filepath.Join(t.TempDir(), "mtime.txt")

Callers

nothing calls this directly

Calls 1

dropboxClientModifiedFunction · 0.85

Tested by

no test coverage detected