(t *testing.T)
| 10 | ) |
| 11 | |
| 12 | func TestDefaultEndpoint(t *testing.T) { |
| 13 | err := os.Unsetenv("DOCKER_HOST") |
| 14 | if err != nil { |
| 15 | t.Fatalf("Unable to unset DOCKER_HOST: %s", err) |
| 16 | } |
| 17 | |
| 18 | endpoint, err := GetEndpoint("") |
| 19 | if err != nil { |
| 20 | t.Fatalf("%s", err) |
| 21 | } |
| 22 | if endpoint != "unix:///var/run/docker.sock" { |
| 23 | t.Fatalf("Expected unix:///var/run/docker.sock, got %s", endpoint) |
| 24 | } |
| 25 | } |
| 26 | |
| 27 | func TestDockerHostEndpoint(t *testing.T) { |
| 28 | err := os.Setenv("DOCKER_HOST", "tcp://127.0.0.1:4243") |
nothing calls this directly
no test coverage detected