MCPcopy Create free account
hub / github.com/Driver-C/tryssh / TestRunEncrypt_EnvVar_WithPasswords

Function TestRunEncrypt_EnvVar_WithPasswords

cmd/encrypt/encrypt_test.go:132–145  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

130}
131
132func TestRunEncrypt_EnvVar_WithPasswords(t *testing.T) {
133 defer resetMocks()
134 setupTempConfig(t, configWithPasswordsYAML)
135
136 os.Setenv("TRYSSH_MASTER_KEY", "testpassword123")
137 runEncrypt()
138
139 configPath := config.DefaultConfigPath
140 data, err := os.ReadFile(configPath)
141 require.NoError(t, err)
142 content := string(data)
143 assert.Contains(t, content, "enc:")
144 assert.NotContains(t, content, "secret1")
145}
146
147// --- runEncrypt interactive path (injected readPasswordFn) ---
148

Callers

nothing calls this directly

Calls 3

resetMocksFunction · 0.85
runEncryptFunction · 0.85
setupTempConfigFunction · 0.70

Tested by

no test coverage detected