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

Function TestFormatFileMetadataLongIncludesFields

cmd/ls_test.go:106–127  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

104}
105
106func TestFormatFileMetadataLongIncludesFields(t *testing.T) {
107 ts := time.Date(2025, 1, 15, 10, 30, 0, 0, time.UTC)
108 meta := &files.FileMetadata{
109 Metadata: files.Metadata{
110 PathDisplay: "/data.csv",
111 },
112 Rev: "rev999",
113 Size: 2048,
114 ServerModified: dropbox.DBXTime(ts),
115 }
116
117 got := formatFileMetadata(meta, true)
118 if !contains(got, "rev999") {
119 t.Errorf("long format should contain rev, got %q", got)
120 }
121 if !contains(got, "2.0 KiB") {
122 t.Errorf("long format should contain human size, got %q", got)
123 }
124 if !contains(got, "/data.csv") {
125 t.Errorf("long format should contain path, got %q", got)
126 }
127}
128
129func TestGetFileMetadataNotCalledForRoot(t *testing.T) {
130 // This test verifies the ls function logic:

Callers

nothing calls this directly

Calls 2

formatFileMetadataFunction · 0.85
containsFunction · 0.85

Tested by

no test coverage detected