docker: move dockerClient to an interface #44
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This should be a less opinionated change based on #30.
Unit testing
docker_image_src.goanddocker_image_dest_goshould be easier after this as we can mock up the entire client (along the line of d5cbfe9).This change goes along with #42 where we set the actual client in the
dockerClientstruct - thus, allowing more fine grained unit tests like the ones expressed in d5cbfe9#r69351589. Arguably I think the same unit tests can be done with just #42 because we can mock the entire client there as well.@mtrmac PTAL, eventually using Go
httptestpackage is what we'll end up - but this ease the burden of having to setup anhttptestserver everytime with different settings and handlers and just mocking the whole makeRequest* game. We can still usehttptestin adocker_client_test.goto test authentication, ping, https/http detection and what not.Signed-off-by: Antonio Murdaca runcom@redhat.com