(t *testing.T)
| 41 | } |
| 42 | |
| 43 | func 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 | |
| 60 | func TestUnixBadFormat(t *testing.T) { |
| 61 | endpoint := "unix:/var/run/docker.sock" |
nothing calls this directly
no test coverage detected