googleapis / googleapis/cloud-bigtable-cbt-cli
Add mocks for unit tests
Open
priority: p3
type: cleanup
- Dominant language
- Go
- Stars
- 15
- Forks
- 42
- PR merge metrics
- No merged PRs in 30d
Description
Right now the cbt tool doesn't have robust unit tests for individual CLI functions (`doLookup()`, `doRead()`, etc). These functions should have some tests attached to them:
+ Encapsulate all of the functions inside of a struct that can be mocked.
+ Add a dependency to the [gomock](https://github.com/golang/mock) framework.
+ Add a `go:generate` statement that updates the cbt mock structs.
+ Add tests for each method in the CBT that uses the mock frameworks.
Contributor guide
Assessment
This issue has not been assessed yet.