Skip to content

Commit

Permalink
Remove a couple of leftover --unsafe test cases
Browse files Browse the repository at this point in the history
These were injecting the `unsafe` flag directly into the parsed CLI
context so the flag was silently ignored, but the tests don't check
anything that isn't already checked in other test cases.
  • Loading branch information
kpitt committed Sep 28, 2022
1 parent 9cf526b commit 57dd0c2
Showing 1 changed file with 0 additions and 24 deletions.
24 changes: 0 additions & 24 deletions internal/action/show_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -196,18 +196,6 @@ func TestShowAutoClip(t *testing.T) { //nolint:paralleltest
stderrBuf.Reset()
})

// gopass show -f foo
// -> ONLY print
t.Run("gopass show -f foo", func(t *testing.T) { //nolint:paralleltest
c := gptest.CliCtxWithFlags(ctx, t, map[string]string{"unsafe": "true"}, "foo")
assert.NoError(t, act.Show(c))
assert.NotContains(t, stderrBuf.String(), "WARNING")
assert.Contains(t, stdoutBuf.String(), "secret")
assert.Contains(t, stdoutBuf.String(), "second")
stdoutBuf.Reset()
stderrBuf.Reset()
})

// gopass show foo
// -> Copy to clipboard
t.Run("gopass show foo", func(t *testing.T) { //nolint:paralleltest
Expand Down Expand Up @@ -241,18 +229,6 @@ func TestShowAutoClip(t *testing.T) { //nolint:paralleltest
stdoutBuf.Reset()
stderrBuf.Reset()
})

// gopass show -f foo
// -> ONLY Print
t.Run("gopass show -f foo", func(t *testing.T) { //nolint:paralleltest
c := gptest.CliCtxWithFlags(ctx, t, map[string]string{"unsafe": "true"}, "foo")
assert.NoError(t, act.Show(c))
assert.NotContains(t, stderrBuf.String(), "WARNING")
assert.Contains(t, stdoutBuf.String(), "secret")
assert.Contains(t, stdoutBuf.String(), "second")
stdoutBuf.Reset()
stderrBuf.Reset()
})
}

func TestShowHandleRevision(t *testing.T) { //nolint:paralleltest
Expand Down

0 comments on commit 57dd0c2

Please sign in to comment.