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

Function TestHostInUseByAnother

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

Source from the content-addressed store, hash-verified

63}
64
65func TestHostInUseByAnother(t *testing.T) {
66 ns := &Namespace{name: "test"}
67 ns.applications = append(ns.applications,
68 NewApplication(ns, ApplicationSettings{Name: "app1", Host: "shared.localhost"}),
69 NewApplication(ns, ApplicationSettings{Name: "app2", Host: "unique.localhost"}),
70 )
71
72 assert.False(t, ns.HostInUseByAnother("shared.localhost", "app1"))
73 assert.True(t, ns.HostInUseByAnother("shared.localhost", "app2"))
74 assert.False(t, ns.HostInUseByAnother("other.localhost", "app1"))
75}
76
77func TestNewApplicationDoesNotAffectNamespace(t *testing.T) {
78 ns := &Namespace{name: "test"}

Callers

nothing calls this directly

Calls 2

HostInUseByAnotherMethod · 0.95
NewApplicationFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…