mirror of
https://github.com/gopasspw/gopass.git
synced 2025-12-08 19:24:54 +00:00
* [chore] Migrate to golangci-lint v2 Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org> * [chore] Fix more lint issues Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org> * [chore] Fix more lint issue Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org> * [chore] Fix more lint issues Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org> * [chore] Add more package comments. Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org> * [chore] Fix golangci-lint config and the remaining checks Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org> * [fix] Use Go 1.24 Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org> * [fix] Fix container builds Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org> * Fix more failing tests Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org> * Fix test failure Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org> * Fix another len assertion Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org> * Move location tests Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org> * [fix] Fix most remaining lint issues Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org> * [fix] Only run XDG specific tests on linux Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org> * [fix] Attempt to address on source of flaky failures Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org> --------- Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
39 lines
662 B
Go
39 lines
662 B
Go
package notify
|
|
|
|
import (
|
|
"image/png"
|
|
"os"
|
|
"strings"
|
|
"testing"
|
|
|
|
"github.com/gopasspw/gopass/internal/config"
|
|
"github.com/stretchr/testify/require"
|
|
)
|
|
|
|
func TestNotify(t *testing.T) {
|
|
ctx := config.NewContextInMemory()
|
|
|
|
t.Setenv("GOPASS_NO_NOTIFY", "true")
|
|
require.NoError(t, Notify(ctx, "foo", "bar"))
|
|
}
|
|
|
|
func TestIcon(t *testing.T) {
|
|
t.Parallel()
|
|
|
|
ctx := t.Context()
|
|
|
|
fn := strings.TrimPrefix(iconURI(ctx), "file://")
|
|
require.NoError(t, os.Remove(fn))
|
|
_ = iconURI(ctx)
|
|
fh, err := os.Open(fn)
|
|
require.NoError(t, err)
|
|
|
|
defer func() {
|
|
require.NoError(t, fh.Close())
|
|
}()
|
|
|
|
require.NotNil(t, fh)
|
|
_, err = png.Decode(fh)
|
|
require.NoError(t, err)
|
|
}
|