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

Function TestValidate

cli/compose/schema/schema_test.go:15–30  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

13type dict map[string]any
14
15func TestValidate(t *testing.T) {
16 config := dict{
17 "version": "3.0",
18 "services": dict{
19 "foo": dict{
20 "image": "busybox",
21 },
22 },
23 }
24
25 assert.NilError(t, Validate(config, "3.0"))
26 assert.NilError(t, Validate(config, "3"))
27 assert.NilError(t, Validate(config, ""))
28 assert.ErrorContains(t, Validate(config, "1.0"), "unsupported Compose file version: 1.0")
29 assert.ErrorContains(t, Validate(config, "12345"), "unsupported Compose file version: 12345")
30}
31
32func TestValidatePorts(t *testing.T) {
33 testcases := []struct {

Callers

nothing calls this directly

Calls 1

ValidateFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…