@@ -288,7 +288,7 @@ func TestNetworkInspect(t *testing.T) {
288
288
helpers .Ensure ("create" , "--name" , data .Identifier ("nginx-container-2" ), "--network" , data .Identifier ("nginx-network-1" ), testutil .NginxAlpineImage )
289
289
helpers .Ensure ("create" , "--name" , data .Identifier ("nginx-container-on-diff-network" ), "--network" , data .Identifier ("nginx-network-2" ), testutil .NginxAlpineImage )
290
290
helpers .Ensure ("start" , data .Identifier ("nginx-container-1" ), data .Identifier ("nginx-container-on-diff-network" ))
291
- data .Set ("nginx-container-1-id" , strings .Trim (helpers .Capture ("inspect" , data .Identifier ("nginx-container-1" ), "--format" , "{{.Id}}" ), "\n " ))
291
+ data .Labels (). Set ("nginx-container-1-id" , strings .Trim (helpers .Capture ("inspect" , data .Identifier ("nginx-container-1" ), "--format" , "{{.Id}}" ), "\n " ))
292
292
},
293
293
Cleanup : func (data test.Data , helpers test.Helpers ) {
294
294
helpers .Anyhow ("rm" , "-f" , data .Identifier ("nginx-container-1" ))
@@ -310,7 +310,7 @@ func TestNetworkInspect(t *testing.T) {
310
310
assert .Equal (t , dc [0 ].Name , data .Identifier ("nginx-network-1" ))
311
311
// Assert only the "running" containers on the same network are returned.
312
312
assert .Equal (t , 1 , len (dc [0 ].Containers ), "Expected a single container as per configuration, but got multiple." )
313
- assert .Equal (t , data .Identifier ("nginx-container-1" ), dc [0 ].Containers [data .Get ("nginx-container-1-id" )].Name )
313
+ assert .Equal (t , data .Identifier ("nginx-container-1" ), dc [0 ].Containers [data .Labels (). Get ("nginx-container-1-id" )].Name )
314
314
},
315
315
}
316
316
},
0 commit comments