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

Function TestDeprecatedProperties

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

Source from the content-addressed store, hash-verified

842}
843
844func TestDeprecatedProperties(t *testing.T) {
845 dict, err := ParseYAML([]byte(`
846version: "3"
847services:
848 web:
849 image: web
850 container_name: web
851 db:
852 image: db
853 container_name: db
854 expose: ["5434"]
855`))
856 assert.NilError(t, err)
857
858 configDetails := buildConfigDetails(dict, nil)
859
860 _, err = Load(configDetails)
861 assert.NilError(t, err)
862
863 deprecated := GetDeprecatedProperties(dict)
864 assert.Check(t, is.Len(deprecated, 2))
865 assert.Check(t, is.Contains(deprecated, "container_name"))
866 assert.Check(t, is.Contains(deprecated, "expose"))
867}
868
869func TestForbiddenProperties(t *testing.T) {
870 _, err := loadYAML(`

Callers

nothing calls this directly

Calls 6

ParseYAMLFunction · 0.85
buildConfigDetailsFunction · 0.85
GetDeprecatedPropertiesFunction · 0.85
ContainsMethod · 0.80
LoadFunction · 0.70
LenMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…