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

Function TestTlsEnabled

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

Source from the content-addressed store, hash-verified

225}
226
227func TestTlsEnabled(t *testing.T) {
228 tls := tlsEnabled("foo", "bar", "baz")
229 assert.False(t, tls)
230
231 filepaths := map[string]string{
232 "cert": "",
233 "caCert": "",
234 "key": "",
235 }
236 // Create temporary files
237 for key := range filepaths {
238 file, err := os.CreateTemp("", key)
239 if err != nil {
240 t.Fatal(err)
241 }
242 defer os.Remove(file.Name())
243 filepaths[key] = file.Name()
244 }
245
246 tls = tlsEnabled(filepaths["cert"], filepaths["caCert"], filepaths["key"])
247 assert.True(t, tls)
248}

Callers

nothing calls this directly

Calls 1

tlsEnabledFunction · 0.85

Tested by

no test coverage detected