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

Function TestHostInUse

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

Source from the content-addressed store, hash-verified

51}
52
53func TestHostInUse(t *testing.T) {
54 ns := &Namespace{name: "test"}
55 ns.applications = append(ns.applications,
56 NewApplication(ns, ApplicationSettings{Name: "app1", Host: "app1.localhost"}),
57 NewApplication(ns, ApplicationSettings{Name: "app2", Host: "app2.localhost"}),
58 )
59
60 assert.True(t, ns.HostInUse("app1.localhost"))
61 assert.True(t, ns.HostInUse("app2.localhost"))
62 assert.False(t, ns.HostInUse("other.localhost"))
63}
64
65func TestHostInUseByAnother(t *testing.T) {
66 ns := &Namespace{name: "test"}

Callers

nothing calls this directly

Calls 2

HostInUseMethod · 0.95
NewApplicationFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…