MCPcopy Create free account
hub / github.com/nginx-proxy/docker-gen / TestDockerFlagEndpoint

Function TestDockerFlagEndpoint

internal/dockerclient/docker_cli_test.go:43–58  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

41}
42
43func TestDockerFlagEndpoint(t *testing.T) {
44
45 err := os.Setenv("DOCKER_HOST", "tcp://127.0.0.1:4243")
46 if err != nil {
47 t.Fatalf("Unable to set DOCKER_HOST: %s", err)
48 }
49
50 // flag value should override DOCKER_HOST and default value
51 endpoint, err := GetEndpoint("tcp://127.0.0.1:5555")
52 if err != nil {
53 t.Fatalf("%s", err)
54 }
55 if endpoint != "tcp://127.0.0.1:5555" {
56 t.Fatalf("Expected tcp://127.0.0.1:5555, got %s", endpoint)
57 }
58}
59
60func TestUnixBadFormat(t *testing.T) {
61 endpoint := "unix:/var/run/docker.sock"

Callers

nothing calls this directly

Calls 1

GetEndpointFunction · 0.85

Tested by

no test coverage detected