Go doesn't seem to have an analog to Python's unittest.mock.patch, so increase test coverage by moving as much as possible out of Get and into pre- and post-fetch helper methods. With this commit, we have:
$ go test -cover ./tools/indextemplate/...
ok github.com/xiekeyang/oci-discovery/tools/indextemplate 0.004s coverage: 74.1% of statements
while before this commit we had:
$ go test -cover ./tools/indextemplate/...
ok github.com/xiekeyang/oci-discovery/tools/indextemplate 0.003s coverage: 33.9% of statements
although not all of that difference is due to better Get decomposition.
Go doesn't seem to have an analog to Python's
unittest.mock.patch
, so increase test coverage by moving as much as possible out ofGet
and into pre- and post-fetch helper methods. With this commit, we have:while before this commit we had:
although not all of that difference is due to better Get decomposition.