INNER CODE UNIT · Go

TestCreateRuntimeClient_Docker

alexei-led/pumba · cmd/main_test.go:134

func TestCreateRuntimeClient_Docker(t *testing.T) {
	restoreFactories(t)

	var gotHost string
	sentinel := ctr.NewMockClient(t)
	newDockerClient = func(host string, _ *tls.Config) (ctr.Client, error) {
		gotHost = host
		return sentinel, nil
	}

	ctx := newRuntimeTestContext(t, map[string]string{
		"runtime": "docker",
		"host":    "unix:///var/run/docker.sock",
	})

	client, err := createRuntimeClient(ctx)
	require.NoError(t, err)
	assert.Same(t, sentinel, client)

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…