MCPcopy Index your code
hub / github.com/coldbrewcloud/coldbrew-cli / TestDefaultConfig

Function TestDefaultConfig

config/default_config_test.go:10–28  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

8)
9
10func TestDefaultConfig(t *testing.T) {
11 defConf := DefaultConfig("app1")
12 assert.Equal(t, "app1", conv.S(defConf.Name))
13 err := defConf.Validate()
14 assert.Nil(t, err)
15
16 // max app name: 32 chars
17 defConf = DefaultConfig("12345678901234567890123456789012")
18 assert.Equal(t, "12345678901234567890123456789012", conv.S(defConf.Name))
19 err = defConf.Validate()
20 assert.Nil(t, err)
21 assert.Len(t, conv.S(defConf.AWS.ELBLoadBalancerName), 32)
22 assert.Len(t, conv.S(defConf.AWS.ELBTargetGroupName), 32)
23
24 // app name's too long
25 defConf = DefaultConfig("123456789012345678901234567890123")
26 err = defConf.Validate()
27 assert.NotNil(t, err)
28}

Callers

nothing calls this directly

Calls 2

DefaultConfigFunction · 0.85
ValidateMethod · 0.80

Tested by

no test coverage detected