MCPcopy
hub / github.com/docker/compose / TestResolveAppID_NameFromComposeFile

Function TestResolveAppID_NameFromComposeFile

cmd/compose/hooks_test.go:275–283  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

273}
274
275func TestResolveAppID_NameFromComposeFile(t *testing.T) {
276 dir := t.TempDir()
277 mustWrite(t, dir, "compose.yaml", "name: from-yaml\nservices:\n svc:\n image: nginx\n")
278 unsetEnv(t, "COMPOSE_PROJECT_NAME")
279 unsetEnv(t, "COMPOSE_FILE")
280
281 got := resolveAppIDIn(t.Context(), nil, dir)
282 assert.Equal(t, got, "from-yaml")
283}
284
285func TestResolveAppID_EnvVarOverridesYAML(t *testing.T) {
286 dir := t.TempDir()

Callers

nothing calls this directly

Calls 4

mustWriteFunction · 0.85
unsetEnvFunction · 0.85
resolveAppIDInFunction · 0.85
TempDirMethod · 0.80

Tested by

no test coverage detected