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

Function TestFormatFileMetadataWithOptsClientTime

cmd/format_test.go:201–216  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

199}
200
201func TestFormatFileMetadataWithOptsClientTime(t *testing.T) {
202 server := time.Date(2025, 1, 1, 0, 0, 0, 0, time.UTC)
203 client := time.Date(2024, 6, 15, 12, 0, 0, 0, time.UTC)
204 meta := &files.FileMetadata{
205 Metadata: files.Metadata{PathDisplay: "/test.txt"},
206 Rev: "abc",
207 Size: 1024,
208 ServerModified: dropbox.DBXTime(server),
209 ClientModified: dropbox.DBXTime(client),
210 }
211
212 got := formatFileMetadataWithOpts(meta, listOptions{long: true, timeField: "client", timeFormat: "short"})
213 if !stringContains(got, "2024-06-15 12:00") {
214 t.Errorf("client time format should show client modified, got %q", got)
215 }
216}

Callers

nothing calls this directly

Calls 2

stringContainsFunction · 0.85

Tested by

no test coverage detected