Skip to content

Commit

Permalink
read: simplify TestSelectTotpCode()
Browse files Browse the repository at this point in the history
  • Loading branch information
vmiklos committed Apr 4, 2024
1 parent 300f8ea commit eeaeb4e
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions commands/read_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,9 @@ func TestSelectTotpCode(t *testing.T) {
expectedMachine := "mymachine"
expectedService := "myservice"
expectedUser := "myuser"
expectedPassword := "totppassword"
var expectedType PasswordType = "totp"
secure := false
_, err := createPassword(&ctx, expectedMachine, expectedService, expectedUser, expectedPassword, expectedType, secure)
_, err := ctx.Database.Exec(`insert into passwords (machine, service, user, password, type) values('mymachine', 'myservice', 'myuser', 'totppassword', 'totp');`)
if err != nil {
t.Fatalf("createPassword() = %q, want nil", err)
t.Fatalf("db.Exec() = %q, want nil", err)
}
os.Args = []string{"", "search", "--noid", "--totp", "-m", expectedMachine, "-s", expectedService, "-u", expectedUser}
inBuf := new(bytes.Buffer)
Expand Down

0 comments on commit eeaeb4e

Please sign in to comment.