MCPcopy Index your code
hub / github.com/docker/cli / TestConvertServiceNetworksCustomDefault

Function TestConvertServiceNetworksCustomDefault

cli/compose/convert/service_test.go:293–314  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

291}
292
293func TestConvertServiceNetworksCustomDefault(t *testing.T) {
294 networkConfigs := networkMap{
295 "default": composetypes.NetworkConfig{
296 External: composetypes.External{External: true},
297 Name: "custom",
298 },
299 }
300 networks := map[string]*composetypes.ServiceNetworkConfig{}
301
302 configs, err := convertServiceNetworks(
303 networks, networkConfigs, NewNamespace("foo"), "service")
304
305 expected := []swarm.NetworkAttachmentConfig{
306 {
307 Target: "custom",
308 Aliases: []string{"service"},
309 },
310 }
311
312 assert.NilError(t, err)
313 assert.Check(t, is.DeepEqual(expected, configs))
314}
315
316func TestConvertDNSConfigEmpty(t *testing.T) {
317 dnsConfig := convertDNSConfig(nil, nil)

Callers

nothing calls this directly

Calls 2

convertServiceNetworksFunction · 0.85
NewNamespaceFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…