Skip to content

Commit

Permalink
cleanup generic password test (#100)
Browse files Browse the repository at this point in the history
  • Loading branch information
joshblum committed May 23, 2023
1 parent 45f7288 commit b561510
Showing 1 changed file with 2 additions and 17 deletions.
19 changes: 2 additions & 17 deletions macos_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ func TestUpdateItem(t *testing.T) {
}
}

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

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

// Query reference and delete by reference
query := NewItem()
query.SetSecClass(SecClassGenericPassword)
query.SetService(service)
query.SetAccount(account)
query.SetMatchLimit(MatchLimitOne)
query.SetReturnRef(true)
ref, err := QueryItemRef(query)
err = DeleteItem(item)
if err != nil {
t.Fatal(err)
} else if ref == 0 {
t.Fatal("Missing result")
} else {
err = DeleteItem(item)
if err != nil {
t.Fatal(err)
}
Release(ref)
}

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

0 comments on commit b561510

Please sign in to comment.