@@ -11,7 +11,6 @@ import (
1111 "strings"
1212 "testing"
1313
14- "github.com/docker/docker/api"
1514 "github.com/docker/docker/api/types"
1615 "gotest.tools/v3/assert"
1716 is "gotest.tools/v3/assert/cmp"
@@ -30,7 +29,7 @@ func TestNewClientWithOpsFromEnv(t *testing.T) {
3029 {
3130 doc : "default api version" ,
3231 envs : map [string ]string {},
33- expectedVersion : api . DefaultVersion ,
32+ expectedVersion : DefaultAPIVersion ,
3433 },
3534 {
3635 doc : "invalid cert path" ,
@@ -44,23 +43,23 @@ func TestNewClientWithOpsFromEnv(t *testing.T) {
4443 envs : map [string ]string {
4544 "DOCKER_CERT_PATH" : "testdata/" ,
4645 },
47- expectedVersion : api . DefaultVersion ,
46+ expectedVersion : DefaultAPIVersion ,
4847 },
4948 {
5049 doc : "default api version with cert path and tls verify" ,
5150 envs : map [string ]string {
5251 "DOCKER_CERT_PATH" : "testdata/" ,
5352 "DOCKER_TLS_VERIFY" : "1" ,
5453 },
55- expectedVersion : api . DefaultVersion ,
54+ expectedVersion : DefaultAPIVersion ,
5655 },
5756 {
5857 doc : "default api version with cert path and host" ,
5958 envs : map [string ]string {
6059 "DOCKER_CERT_PATH" : "testdata/" ,
6160 "DOCKER_HOST" : "https://notaunixsocket" ,
6261 },
63- expectedVersion : api . DefaultVersion ,
62+ expectedVersion : DefaultAPIVersion ,
6463 },
6564 {
6665 doc : "invalid docker host" ,
@@ -74,7 +73,7 @@ func TestNewClientWithOpsFromEnv(t *testing.T) {
7473 envs : map [string ]string {
7574 "DOCKER_HOST" : "invalid://url" ,
7675 },
77- expectedVersion : api . DefaultVersion ,
76+ expectedVersion : DefaultAPIVersion ,
7877 },
7978 {
8079 doc : "override api version" ,
@@ -117,17 +116,17 @@ func TestGetAPIPath(t *testing.T) {
117116 }{
118117 {
119118 path : "/containers/json" ,
120- expected : "/v" + api . DefaultVersion + "/containers/json" ,
119+ expected : "/v" + DefaultAPIVersion + "/containers/json" ,
121120 },
122121 {
123122 path : "/containers/json" ,
124123 query : url.Values {},
125- expected : "/v" + api . DefaultVersion + "/containers/json" ,
124+ expected : "/v" + DefaultAPIVersion + "/containers/json" ,
126125 },
127126 {
128127 path : "/containers/json" ,
129128 query : url.Values {"s" : []string {"c" }},
130- expected : "/v" + api . DefaultVersion + "/containers/json?s=c" ,
129+ expected : "/v" + DefaultAPIVersion + "/containers/json?s=c" ,
131130 },
132131 {
133132 version : "1.22" ,
@@ -235,7 +234,7 @@ func TestNewClientWithOpsFromEnvSetsDefaultVersion(t *testing.T) {
235234
236235 client , err := NewClientWithOpts (FromEnv )
237236 assert .NilError (t , err )
238- assert .Check (t , is .Equal (client .ClientVersion (), api . DefaultVersion ))
237+ assert .Check (t , is .Equal (client .ClientVersion (), DefaultAPIVersion ))
239238
240239 const expected = "1.22"
241240 t .Setenv ("DOCKER_API_VERSION" , expected )
@@ -375,8 +374,8 @@ func TestNegotiateAPIVersionAutomatic(t *testing.T) {
375374 )
376375 assert .NilError (t , err )
377376
378- // Client defaults to use api.DefaultVersion before version-negotiation.
379- expected := api . DefaultVersion
377+ // Client defaults to use DefaultAPIVersion before version-negotiation.
378+ expected := DefaultAPIVersion
380379 assert .Check (t , is .Equal (client .ClientVersion (), expected ))
381380
382381 // First request should trigger negotiation
@@ -423,7 +422,7 @@ func TestCustomAPIVersion(t *testing.T) {
423422 }{
424423 {
425424 version : "" ,
426- expected : api . DefaultVersion ,
425+ expected : DefaultAPIVersion ,
427426 },
428427 {
429428 version : "1.0" ,
@@ -435,7 +434,7 @@ func TestCustomAPIVersion(t *testing.T) {
435434 },
436435 {
437436 version : "v" ,
438- expected : api . DefaultVersion ,
437+ expected : DefaultAPIVersion ,
439438 },
440439 {
441440 version : "v1.0" ,
0 commit comments