Commit eb03be3
Add comprehensive tests for origin/blobclient client.go [AI Generated] (#537)
* Add comprehensive tests for origin/blobclient client.go
- Add unit tests for HTTPClient constructor and options
- Add tests for all Client interface methods
- Cover success paths, error handling, and edge cases
- Achieve 100% coverage on 17/20 functions
- Test chunked upload flow (TransferBlob, UploadBlob, DuplicateUploadBlob)
- Test blob operations (Stat, Download, Prefetch, Delete)
- Test metadata operations (GetMetaInfo, OverwriteMetaInfo)
- Test cluster operations (Locations, ReplicateToRemote, GetPeerContext)
* Refactor blobclient tests to use table-driven tests
- Convert tests to table-driven format for better readability
- Add testServer() helper with t.Cleanup() for automatic cleanup
- Add statusHandler() and statusWithBodyHandler() helpers
- Reduce code duplication across test cases
- Reduce file size from 1062 to 993 lines (~7% reduction)
- Maintain same test coverage (44.9%)
---------
Co-authored-by: gauravk <gauravk@uber.com>1 parent b1116ed commit eb03be3
1 file changed
+993
-0
lines changed
0 commit comments