(t *testing.T)
| 71 | } |
| 72 | |
| 73 | func TestConfigLoadEncryptedWithInvalidPassCommand(t *testing.T) { |
| 74 | ctx := context.Background() |
| 75 | ci := fs.GetConfig(ctx) |
| 76 | oldConfigPath := config.GetConfigPath() |
| 77 | oldConfig := *ci |
| 78 | assert.NoError(t, config.SetConfigPath("./testdata/encrypted.conf")) |
| 79 | // using ci.PasswordCommand, incorrect password |
| 80 | ci.PasswordCommand = fs.SpaceSepList{"echo", "asdf-blurfl"} |
| 81 | defer func() { |
| 82 | assert.NoError(t, config.SetConfigPath(oldConfigPath)) |
| 83 | config.ClearConfigPassword() |
| 84 | *ci = oldConfig |
| 85 | ci.PasswordCommand = nil |
| 86 | }() |
| 87 | |
| 88 | config.ClearConfigPassword() |
| 89 | |
| 90 | err := config.Data().Load() |
| 91 | require.Error(t, err) |
| 92 | assert.Contains(t, err.Error(), "using --password-command derived password") |
| 93 | } |
| 94 | |
| 95 | func TestConfigLoadEncryptedFailures(t *testing.T) { |
| 96 | var err error |
nothing calls this directly
no test coverage detected
searching dependent graphs…