MCPcopy Create free account
hub / github.com/docker/cli / TestTransform

Function TestTransform

cli/compose/loader/loader_test.go:1682–1704  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

1680}
1681
1682func TestTransform(t *testing.T) {
1683 source := []any{
1684 "80-82:8080-8082",
1685 "90-92:8090-8092/udp",
1686 "85:8500",
1687 8600,
1688 map[string]any{
1689 "protocol": "udp",
1690 "target": 53,
1691 "published": 10053,
1692 },
1693 map[string]any{
1694 "mode": "host",
1695 "target": 22,
1696 "published": 10022,
1697 },
1698 }
1699 var ports []types.ServicePortConfig
1700 err := Transform(source, &ports)
1701 assert.NilError(t, err)
1702
1703 assert.Check(t, is.DeepEqual(samplePortsConfig, ports))
1704}
1705
1706func TestLoadTemplateDriver(t *testing.T) {
1707 config, err := loadYAML(`

Callers

nothing calls this directly

Calls 1

TransformFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…