MCPcopy Create free account
hub / github.com/compose-spec/compose-go / TestImplicitContextPath

Function TestImplicitContextPath

loader/normalize_test.go:243–274  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

241}
242
243func TestImplicitContextPath(t *testing.T) {
244 project := `
245name: myProject
246services:
247 test:
248 build: {}
249`
250 expected := `
251name: myProject
252services:
253 test:
254 build:
255 context: .
256 dockerfile: "Dockerfile"
257 networks:
258 default: null
259networks:
260 default:
261 name: myProject_default
262`
263
264 var model map[string]any
265 err := yaml.Unmarshal([]byte(project), &model)
266 assert.NilError(t, err)
267 model, err = Normalize(model, nil)
268 assert.NilError(t, err)
269
270 var expect map[string]any
271 err = yaml.Unmarshal([]byte(expected), &expect)
272 assert.NilError(t, err)
273 assert.DeepEqual(t, expect, model)
274}
275
276func TestNormalizeDefaultNetwork(t *testing.T) {
277 project := `

Callers

nothing calls this directly

Calls 1

NormalizeFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…