MCPcopy
hub / github.com/basecamp/once / TestNewApplicationDoesNotAffectNamespace

Function TestNewApplicationDoesNotAffectNamespace

internal/docker/namespace_test.go:77–88  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

75}
76
77func TestNewApplicationDoesNotAffectNamespace(t *testing.T) {
78 ns := &Namespace{name: "test"}
79 ns.addApplication(ApplicationSettings{Name: "existing", Host: "existing.localhost"})
80
81 // NewApplication creates a standalone app without adding it to the namespace
82 app := NewApplication(ns, ApplicationSettings{Name: "standalone", Host: "standalone.localhost"})
83
84 assert.Nil(t, ns.Application("standalone"))
85 assert.False(t, ns.HostInUse("standalone.localhost"))
86 assert.Len(t, ns.Applications(), 1)
87 assert.Equal(t, "standalone", app.Settings.Name)
88}
89
90func TestContainerAppName(t *testing.T) {
91 ns := &Namespace{name: "once"}

Callers

nothing calls this directly

Calls 7

addApplicationMethod · 0.95
ApplicationMethod · 0.95
HostInUseMethod · 0.95
ApplicationsMethod · 0.95
NewApplicationFunction · 0.85
LenMethod · 0.80
EqualMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…