(t *testing.T)
| 421 | } |
| 422 | |
| 423 | func TestResolveDestination_MetadataError(t *testing.T) { |
| 424 | mock := &mockFilesClient{ |
| 425 | getMetadataFn: func(arg *files.GetMetadataArg) (files.IsMetadata, error) { |
| 426 | return nil, fmt.Errorf("server error 500") |
| 427 | }, |
| 428 | } |
| 429 | got := resolveDestination(mock, "/local/a.txt", "/path", false) |
| 430 | if got != "/path" { |
| 431 | t.Errorf("resolveDestination = %q, want /path (fallback on error)", got) |
| 432 | } |
| 433 | } |
| 434 | |
| 435 | func TestPutFileDestinationTrailingSlash(t *testing.T) { |
| 436 | tmpFile := filepath.Join(t.TempDir(), "a.txt") |
nothing calls this directly
no test coverage detected