@@ -288,7 +288,7 @@ func TestNetworkInspect(t *testing.T) {
288288 helpers .Ensure ("create" , "--name" , data .Identifier ("nginx-container-2" ), "--network" , data .Identifier ("nginx-network-1" ), testutil .NginxAlpineImage )
289289 helpers .Ensure ("create" , "--name" , data .Identifier ("nginx-container-on-diff-network" ), "--network" , data .Identifier ("nginx-network-2" ), testutil .NginxAlpineImage )
290290 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 " ))
292292 },
293293 Cleanup : func (data test.Data , helpers test.Helpers ) {
294294 helpers .Anyhow ("rm" , "-f" , data .Identifier ("nginx-container-1" ))
@@ -310,7 +310,7 @@ func TestNetworkInspect(t *testing.T) {
310310 assert .Equal (t , dc [0 ].Name , data .Identifier ("nginx-network-1" ))
311311 // Assert only the "running" containers on the same network are returned.
312312 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 )
314314 },
315315 }
316316 },
0 commit comments