mirror of
https://github.com/ProtonMail/go-keychain.git
synced 2026-01-11 19:58:20 +00:00
cleanup generic password test (#100)
This commit is contained in:
parent
45f7288cfc
commit
b5615109f1
1 changed files with 2 additions and 17 deletions
|
|
@ -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)
|
||||
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue