diff options
author | Stephen J Day <stephen.day@docker.com> | 2016-09-08 20:44:25 -0700 |
---|---|---|
committer | Stephen J Day <stephen.day@docker.com> | 2016-09-19 11:19:55 -0700 |
commit | 9a072adff3fcd90c4f36214b355ef27b423f0144 (patch) | |
tree | 6446b5142faf77cfdd5af70093ed450b2f78bdf6 /client/container_stats_test.go | |
parent | 9d7be9df8f79b26a4b9778851cf19a6579f8bc61 (diff) | |
download | docker-9a072adff3fcd90c4f36214b355ef27b423f0144.tar.gz |
client: remove transport package
This package doesn't really seem to do anything of real interest.
Removing it and replacing with a few helper functions. Most of this was
maintaining a fork of ctxhttp to support a mock that was unnecessary.
We could probably do with a further refactor of the client interface.
There is a lot of confusion of between transport, http layer and
application layer that makes for some awkward code. This change
improves the situation to the point where no breaking changes are
introduced.
Signed-off-by: Stephen J Day <stephen.day@docker.com>
Diffstat (limited to 'client/container_stats_test.go')
-rw-r--r-- | client/container_stats_test.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/client/container_stats_test.go b/client/container_stats_test.go index 22ecd6170f..76e4a09ddf 100644 --- a/client/container_stats_test.go +++ b/client/container_stats_test.go @@ -13,7 +13,7 @@ import ( func TestContainerStatsError(t *testing.T) { client := &Client{ - transport: newMockClient(nil, errorMock(http.StatusInternalServerError, "Server error")), + client: newMockClient(errorMock(http.StatusInternalServerError, "Server error")), } _, err := client.ContainerStats(context.Background(), "nothing", false) if err == nil || err.Error() != "Error response from daemon: Server error" { @@ -37,7 +37,7 @@ func TestContainerStats(t *testing.T) { } for _, c := range cases { client := &Client{ - transport: newMockClient(nil, func(r *http.Request) (*http.Response, error) { + client: newMockClient(func(r *http.Request) (*http.Response, error) { if !strings.HasPrefix(r.URL.Path, expectedURL) { return nil, fmt.Errorf("Expected URL '%s', got '%s'", expectedURL, r.URL) } |