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

Function TestIsListRevisionsNotFileErrorHandlesWrappedErrors

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

Source from the content-addressed store, hash-verified

677}
678
679func TestIsListRevisionsNotFileErrorHandlesWrappedErrors(t *testing.T) {
680 apiErr := files.ListRevisionsAPIError{
681 EndpointError: &files.ListRevisionsError{
682 Path: &files.LookupError{Tagged: dropbox.Tagged{Tag: files.LookupErrorNotFile}},
683 },
684 }
685
686 if !isListRevisionsNotFileError(apiErr) {
687 t.Fatal("expected raw list_revisions not_file error to match")
688 }
689 if !isListRevisionsNotFileError(fmt.Errorf("wrapped: %w", apiErr)) {
690 t.Fatal("expected wrapped list_revisions not_file error to match")
691 }
692}
693
694func contains(s, substr string) bool {
695 return len(s) >= len(substr) && (s == substr || len(s) > 0 && stringContains(s, substr))

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected