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

Function TestFormatFileMetadataWithOptsLongShortTime

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

Source from the content-addressed store, hash-verified

181}
182
183func TestFormatFileMetadataWithOptsLongShortTime(t *testing.T) {
184 ts := time.Date(2025, 3, 15, 10, 30, 0, 0, time.UTC)
185 meta := &files.FileMetadata{
186 Metadata: files.Metadata{PathDisplay: "/test.txt"},
187 Rev: "abc",
188 Size: 4096,
189 ServerModified: dropbox.DBXTime(ts),
190 }
191
192 got := formatFileMetadataWithOpts(meta, listOptions{long: true, timeFormat: "short"})
193 if !stringContains(got, "2025-03-15 10:30") {
194 t.Errorf("long short-time format should contain absolute time, got %q", got)
195 }
196 if !stringContains(got, "4.0 KiB") {
197 t.Errorf("long format should contain size, got %q", got)
198 }
199}
200
201func TestFormatFileMetadataWithOptsClientTime(t *testing.T) {
202 server := time.Date(2025, 1, 1, 0, 0, 0, 0, time.UTC)

Callers

nothing calls this directly

Calls 2

stringContainsFunction · 0.85

Tested by

no test coverage detected