Skip to content

Commit b561510

Browse files
authored
cleanup generic password test (keybase#100)
1 parent 45f7288 commit b561510

File tree

1 file changed

+2
-17
lines changed

1 file changed

+2
-17
lines changed

macos_test.go

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ func TestUpdateItem(t *testing.T) {
4545
}
4646
}
4747

48-
func TestGenericPasswordRef(t *testing.T) {
48+
func TestGenericPassword(t *testing.T) {
4949
service, account, label, accessGroup, password := "TestGenericPasswordRef", "test", "", "", "toomanysecrets"
5050

5151
item := NewGenericPassword(service, account, label, []byte(password), accessGroup)
@@ -55,24 +55,9 @@ func TestGenericPasswordRef(t *testing.T) {
5555
t.Fatal(err)
5656
}
5757

58-
// Query reference and delete by reference
59-
query := NewItem()
60-
query.SetSecClass(SecClassGenericPassword)
61-
query.SetService(service)
62-
query.SetAccount(account)
63-
query.SetMatchLimit(MatchLimitOne)
64-
query.SetReturnRef(true)
65-
ref, err := QueryItemRef(query)
58+
err = DeleteItem(item)
6659
if err != nil {
6760
t.Fatal(err)
68-
} else if ref == 0 {
69-
t.Fatal("Missing result")
70-
} else {
71-
err = DeleteItem(item)
72-
if err != nil {
73-
t.Fatal(err)
74-
}
75-
Release(ref)
7661
}
7762

7863
passwordAfter, err := GetGenericPassword(service, account, label, accessGroup)

0 commit comments

Comments
 (0)