MCPcopy Create free account
hub / github.com/diillson/chatcli / TestIsSensitiveEnvKey

Function TestIsSensitiveEnvKey

utils/utils_test.go:83–104  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

81}
82
83func TestIsSensitiveEnvKey(t *testing.T) {
84 testCases := []struct {
85 key string
86 expected bool
87 }{
88 {"OPENAI_API_KEY", true},
89 {"CLIENT_SECRET", true},
90 {"CLIENT_KEY", true},
91 {"MY_APP_TOKEN", true},
92 {"MY_APP_TOKEN", true},
93 {"PASSWORD_VAR", true},
94 {"some_secret_value", true},
95 {"USERNAME", false},
96 {"LOG_LEVEL", false},
97 }
98
99 for _, tc := range testCases {
100 t.Run(tc.key, func(t *testing.T) {
101 assert.Equal(t, tc.expected, isSensitiveEnvKey(tc.key))
102 })
103 }
104}
105
106func TestExpandPath(t *testing.T) {
107 homeDir, err := os.UserHomeDir()

Callers

nothing calls this directly

Calls 3

isSensitiveEnvKeyFunction · 0.85
EqualMethod · 0.80
RunMethod · 0.65

Tested by

no test coverage detected