mirror of
https://github.com/gopasspw/gopass.git
synced 2025-12-08 19:24:54 +00:00
* [bugfix] Fix writes to global config from tests Fixes #2725 Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org> * Shorten readonly config creation. Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org> * Address review comments Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org> --------- Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
21 lines
421 B
Go
21 lines
421 B
Go
package cui
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/gopasspw/gopass/internal/config"
|
|
"github.com/gopasspw/gopass/pkg/ctxutil"
|
|
"github.com/stretchr/testify/assert"
|
|
)
|
|
|
|
func TestGetSelection(t *testing.T) {
|
|
t.Parallel()
|
|
|
|
ctx := config.NewContextInMemory()
|
|
ctx = ctxutil.WithInteractive(ctx, false)
|
|
|
|
act, sel := GetSelection(ctx, "foo", []string{"foo", "bar"})
|
|
assert.Equal(t, "impossible", act)
|
|
assert.Equal(t, 0, sel)
|
|
}
|