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

Function TestLsTextUsesCommandOutput

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

Source from the content-addressed store, hash-verified

616}
617
618func TestLsTextUsesCommandOutput(t *testing.T) {
619 cmd, stdout := testLsCmd(t)
620 mock := &mockFilesClient{
621 listFolderFn: func(arg *files.ListFolderArg) (*files.ListFolderResult, error) {
622 return &files.ListFolderResult{
623 Entries: []files.IsMetadata{
624 &files.FolderMetadata{Metadata: files.Metadata{PathDisplay: "/docs"}},
625 },
626 HasMore: false,
627 }, nil
628 },
629 }
630 stubFilesClient(t, mock)
631
632 if err := ls(cmd, nil); err != nil {
633 t.Fatalf("ls error: %v", err)
634 }
635 if got := stdout.String(); !strings.Contains(got, "/docs") {
636 t.Fatalf("stdout = %q, want command output to contain /docs", got)
637 }
638}
639
640func TestLsJSONErrorWritesNoOutput(t *testing.T) {
641 cmd, stdout := testLsCmd(t)

Callers

nothing calls this directly

Calls 3

testLsCmdFunction · 0.85
stubFilesClientFunction · 0.85
lsFunction · 0.85

Tested by

no test coverage detected