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

Function TestIsConflictError

cmd/mkdir_test.go:236–253  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

234}
235
236func TestIsConflictError(t *testing.T) {
237 tests := []struct {
238 msg string
239 want bool
240 }{
241 {"path/conflict/folder/", true},
242 {"path/conflict/file/", true},
243 {"path/not_found/", false},
244 {"some other error", false},
245 }
246
247 for _, tt := range tests {
248 got := isConflictError(fmt.Errorf("%s", tt.msg))
249 if got != tt.want {
250 t.Errorf("isConflictError(%q) = %v, want %v", tt.msg, got, tt.want)
251 }
252 }
253}
254
255func testMkdirCmd(t *testing.T) (*cobra.Command, *bytes.Buffer) {
256 t.Helper()

Callers

nothing calls this directly

Calls 1

isConflictErrorFunction · 0.85

Tested by

no test coverage detected