@@ -10,6 +10,7 @@ import (
1010 . "github.com/docker/cli/internal/test/builders" // Import builders to get the builder function as package function
1111 "github.com/docker/cli/opts"
1212 "github.com/docker/docker/api/types"
13+ "github.com/docker/docker/api/types/container"
1314 "gotest.tools/v3/assert"
1415 is "gotest.tools/v3/assert/cmp"
1516 "gotest.tools/v3/golden"
@@ -129,7 +130,7 @@ func TestContainerListErrors(t *testing.T) {
129130 testCases := []struct {
130131 args []string
131132 flags map [string ]string
132- containerListFunc func (types. ContainerListOptions ) ([]types.Container , error )
133+ containerListFunc func (container. ListOptions ) ([]types.Container , error )
133134 expectedError string
134135 }{
135136 {
@@ -145,7 +146,7 @@ func TestContainerListErrors(t *testing.T) {
145146 expectedError : `wrong number of args for join` ,
146147 },
147148 {
148- containerListFunc : func (_ types. ContainerListOptions ) ([]types.Container , error ) {
149+ containerListFunc : func (_ container. ListOptions ) ([]types.Container , error ) {
149150 return nil , fmt .Errorf ("error listing containers" )
150151 },
151152 expectedError : "error listing containers" ,
@@ -168,7 +169,7 @@ func TestContainerListErrors(t *testing.T) {
168169
169170func TestContainerListWithoutFormat (t * testing.T ) {
170171 cli := test .NewFakeCli (& fakeClient {
171- containerListFunc : func (_ types. ContainerListOptions ) ([]types.Container , error ) {
172+ containerListFunc : func (_ container. ListOptions ) ([]types.Container , error ) {
172173 return []types.Container {
173174 * Container ("c1" ),
174175 * Container ("c2" , WithName ("foo" )),
@@ -185,7 +186,7 @@ func TestContainerListWithoutFormat(t *testing.T) {
185186
186187func TestContainerListNoTrunc (t * testing.T ) {
187188 cli := test .NewFakeCli (& fakeClient {
188- containerListFunc : func (_ types. ContainerListOptions ) ([]types.Container , error ) {
189+ containerListFunc : func (_ container. ListOptions ) ([]types.Container , error ) {
189190 return []types.Container {
190191 * Container ("c1" ),
191192 * Container ("c2" , WithName ("foo/bar" )),
@@ -201,7 +202,7 @@ func TestContainerListNoTrunc(t *testing.T) {
201202// Test for GitHub issue docker/docker#21772
202203func TestContainerListNamesMultipleTime (t * testing.T ) {
203204 cli := test .NewFakeCli (& fakeClient {
204- containerListFunc : func (_ types. ContainerListOptions ) ([]types.Container , error ) {
205+ containerListFunc : func (_ container. ListOptions ) ([]types.Container , error ) {
205206 return []types.Container {
206207 * Container ("c1" ),
207208 * Container ("c2" , WithName ("foo/bar" )),
@@ -217,7 +218,7 @@ func TestContainerListNamesMultipleTime(t *testing.T) {
217218// Test for GitHub issue docker/docker#30291
218219func TestContainerListFormatTemplateWithArg (t * testing.T ) {
219220 cli := test .NewFakeCli (& fakeClient {
220- containerListFunc : func (_ types. ContainerListOptions ) ([]types.Container , error ) {
221+ containerListFunc : func (_ container. ListOptions ) ([]types.Container , error ) {
221222 return []types.Container {
222223 * Container ("c1" , WithLabel ("some.label" , "value" )),
223224 * Container ("c2" , WithName ("foo/bar" ), WithLabel ("foo" , "bar" )),
@@ -268,7 +269,7 @@ func TestContainerListFormatSizeSetsOption(t *testing.T) {
268269 tc := tc
269270 t .Run (tc .doc , func (t * testing.T ) {
270271 cli := test .NewFakeCli (& fakeClient {
271- containerListFunc : func (options types. ContainerListOptions ) ([]types.Container , error ) {
272+ containerListFunc : func (options container. ListOptions ) ([]types.Container , error ) {
272273 assert .Check (t , is .Equal (options .Size , tc .sizeExpected ))
273274 return []types.Container {}, nil
274275 },
@@ -285,7 +286,7 @@ func TestContainerListFormatSizeSetsOption(t *testing.T) {
285286
286287func TestContainerListWithConfigFormat (t * testing.T ) {
287288 cli := test .NewFakeCli (& fakeClient {
288- containerListFunc : func (_ types. ContainerListOptions ) ([]types.Container , error ) {
289+ containerListFunc : func (_ container. ListOptions ) ([]types.Container , error ) {
289290 return []types.Container {
290291 * Container ("c1" , WithLabel ("some.label" , "value" ), WithSize (10700000 )),
291292 * Container ("c2" , WithName ("foo/bar" ), WithLabel ("foo" , "bar" ), WithSize (3200000 )),
@@ -302,7 +303,7 @@ func TestContainerListWithConfigFormat(t *testing.T) {
302303
303304func TestContainerListWithFormat (t * testing.T ) {
304305 cli := test .NewFakeCli (& fakeClient {
305- containerListFunc : func (_ types. ContainerListOptions ) ([]types.Container , error ) {
306+ containerListFunc : func (_ container. ListOptions ) ([]types.Container , error ) {
306307 return []types.Container {
307308 * Container ("c1" , WithLabel ("some.label" , "value" )),
308309 * Container ("c2" , WithName ("foo/bar" ), WithLabel ("foo" , "bar" )),
0 commit comments