MCPcopy Create free account
hub / github.com/couchbase/sync_gateway / TestConfigOverwritesLegacyFlags

Function TestConfigOverwritesLegacyFlags

rest/main_test.go:28–52  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

26}
27
28func TestConfigOverwritesLegacyFlags(t *testing.T) {
29 osArgs := []string{
30 "sync_gateway",
31 // Legacy
32 "-verbose",
33 "-url", "1.2.3.4",
34 "-interface", "1.2.3.4",
35 // Persistent config
36 "-logging.console.log_level", "debug",
37 "-bootstrap.server", "localhost",
38 "-bootstrap.username", "test",
39
40 "config.json",
41 }
42 sc, _, _, err := parseFlags(base.TestCtx(t), osArgs)
43 assert.NoError(t, err)
44
45 require.NotNil(t, sc)
46 // Overwrote
47 assert.Equal(t, base.Ptr(base.LevelDebug), sc.Logging.Console.LogLevel)
48 assert.Equal(t, "localhost", sc.Bootstrap.Server)
49 // Not overwrote
50 assert.Equal(t, "1.2.3.4", sc.API.PublicInterface)
51 assert.Equal(t, "test", sc.Bootstrap.Username)
52}
53
54func TestParseFlags(t *testing.T) {
55 osArgsPrefix := []string{"sync_gateway"}

Callers

nothing calls this directly

Calls 4

TestCtxFunction · 0.92
PtrFunction · 0.92
parseFlagsFunction · 0.85
EqualMethod · 0.45

Tested by

no test coverage detected