MCPcopy Create free account
hub / github.com/anchordotdev/cli / TestCmdBootstrap

Function TestCmdBootstrap

lcl/bootstrap_test.go:23–49  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

21)
22
23func TestCmdBootstrap(t *testing.T) {
24 t.Run("--help", func(t *testing.T) {
25 cmdtest.TestHelp(t, CmdBootstrap, "lcl", "bootstrap", "--help")
26 })
27
28 t.Run("default --addr", func(t *testing.T) {
29 cfg := cmdtest.TestCfg(t, CmdBootstrap)
30 require.Equal(t, ":4433", cfg.Lcl.Diagnostic.Addr)
31 })
32
33 t.Run("-a :4444", func(t *testing.T) {
34 cfg := cmdtest.TestCfg(t, CmdBootstrap, "-a", ":4444")
35 require.Equal(t, ":4444", cfg.Lcl.Diagnostic.Addr)
36 })
37
38 t.Run("--addr :4455", func(t *testing.T) {
39 cfg := cmdtest.TestCfg(t, CmdBootstrap, "--addr", ":4455")
40 require.Equal(t, ":4455", cfg.Lcl.Diagnostic.Addr)
41 })
42
43 t.Run("DIAGNOSTIC_ADDR=:4466", func(t *testing.T) {
44 t.Setenv("DIAGNOSTIC_ADDR", ":4466")
45
46 cfg := cmdtest.TestCfg(t, CmdBootstrap)
47 require.Equal(t, ":4466", cfg.Lcl.Diagnostic.Addr)
48 })
49}
50
51func TestBootstrap(t *testing.T) {
52 ctx, cancel := context.WithCancel(context.Background())

Callers

nothing calls this directly

Calls 4

TestHelpFunction · 0.92
TestCfgFunction · 0.92
EqualMethod · 0.80
RunMethod · 0.65

Tested by

no test coverage detected