MCPcopy
hub / github.com/getsops/sops / TestGnuPGHome_ApplyToMasterKey

Function TestGnuPGHome_ApplyToMasterKey

pgp/keysource_test.go:156–170  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

154}
155
156func TestGnuPGHome_ApplyToMasterKey(t *testing.T) {
157 gnuPGHome, err := NewGnuPGHome()
158 assert.NoError(t, err)
159 t.Cleanup(func() {
160 _ = os.RemoveAll(gnuPGHome.String())
161 })
162
163 key := NewMasterKeyFromFingerprint(mockFingerprint)
164 gnuPGHome.ApplyToMasterKey(key)
165 assert.Equal(t, gnuPGHome.String(), key.gnuPGHomeDir)
166
167 gnuPGHome = "/non/existing/absolute/path/fails/validate"
168 gnuPGHome.ApplyToMasterKey(key)
169 assert.NotEqual(t, gnuPGHome.String(), key.gnuPGHomeDir)
170}
171
172func TestDisableOpenPGP_ApplyToMasterKey(t *testing.T) {
173 key := NewMasterKeyFromFingerprint(mockFingerprint)

Callers

nothing calls this directly

Calls 5

StringMethod · 0.95
ApplyToMasterKeyMethod · 0.95
NewGnuPGHomeFunction · 0.85
CleanupMethod · 0.80

Tested by

no test coverage detected