(t *testing.T)
| 93 | } |
| 94 | |
| 95 | func TestConfigLoadEncryptedFailures(t *testing.T) { |
| 96 | var err error |
| 97 | |
| 98 | // This file should be too short to be decoded. |
| 99 | oldConfigPath := config.GetConfigPath() |
| 100 | assert.NoError(t, config.SetConfigPath("./testdata/enc-short.conf")) |
| 101 | defer func() { assert.NoError(t, config.SetConfigPath(oldConfigPath)) }() |
| 102 | err = config.Data().Load() |
| 103 | require.Error(t, err) |
| 104 | |
| 105 | // This file contains invalid base64 characters. |
| 106 | assert.NoError(t, config.SetConfigPath("./testdata/enc-invalid.conf")) |
| 107 | err = config.Data().Load() |
| 108 | require.Error(t, err) |
| 109 | |
| 110 | // This file contains invalid base64 characters. |
| 111 | assert.NoError(t, config.SetConfigPath("./testdata/enc-too-new.conf")) |
| 112 | err = config.Data().Load() |
| 113 | require.Error(t, err) |
| 114 | |
| 115 | // This file does not exist. |
| 116 | assert.NoError(t, config.SetConfigPath("./testdata/filenotfound.conf")) |
| 117 | err = config.Data().Load() |
| 118 | assert.Equal(t, config.ErrorConfigFileNotFound, err) |
| 119 | } |
| 120 | |
| 121 | func TestGetPasswordCommand(t *testing.T) { |
| 122 | ctx, ci := fs.AddConfig(context.Background()) |
nothing calls this directly
no test coverage detected
searching dependent graphs…