@@ -255,8 +255,14 @@ func TestInitializeFromClientHangs(t *testing.T) {
255255}
256256
257257func TestNewDockerCliAndOperators (t * testing.T ) {
258- // Test default operations and also overriding default ones
259- cli , err := NewDockerCli (WithInputStream (io .NopCloser (strings .NewReader ("some input" ))))
258+ outbuf := bytes .NewBuffer (nil )
259+ errbuf := bytes .NewBuffer (nil )
260+
261+ cli , err := NewDockerCli (
262+ WithInputStream (io .NopCloser (strings .NewReader ("some input" ))),
263+ WithOutputStream (outbuf ),
264+ WithErrorStream (errbuf ),
265+ )
260266 assert .NilError (t , err )
261267 // Check streams are initialized
262268 assert .Check (t , cli .In () != nil )
@@ -266,19 +272,6 @@ func TestNewDockerCliAndOperators(t *testing.T) {
266272 assert .NilError (t , err )
267273 assert .Equal (t , string (inputStream ), "some input" )
268274
269- // Apply can modify a dockerCli after construction
270- outbuf := bytes .NewBuffer (nil )
271- errbuf := bytes .NewBuffer (nil )
272- err = cli .Apply (
273- WithInputStream (io .NopCloser (strings .NewReader ("input" ))),
274- WithOutputStream (outbuf ),
275- WithErrorStream (errbuf ),
276- )
277- assert .NilError (t , err )
278- // Check input stream
279- inputStream , err = io .ReadAll (cli .In ())
280- assert .NilError (t , err )
281- assert .Equal (t , string (inputStream ), "input" )
282275 // Check output stream
283276 _ , err = fmt .Fprint (cli .Out (), "output" )
284277 assert .NilError (t , err )
0 commit comments