INNER CODE UNIT · Go
TestCreateRuntimeClient_PodmanEmptySocket
alexei-led/pumba · cmd/main_test.go:99
func TestCreateRuntimeClient_PodmanEmptySocket(t *testing.T) {
restoreFactories(t)
var gotSocket string
called := false
newPodmanClient = func(socket string) (ctr.Client, error) {
called = true
gotSocket = socket
return ctr.NewMockClient(t), nil
}
ctx := newRuntimeTestContext(t, map[string]string{"runtime": "podman"})
_, err := createRuntimeClient(ctx)
require.NoError(t, err)
assert.True(t, called, "podman factory should be invoked")
assert.Empty(t, gotSocket, "empty --podman-socket should be passed through so the package auto-detects")
}