[libsecret] Fix collection creation bugs in mock service



commit 4eb3c4577e16feb74870c023eaaa474bc7490a1a
Author: Stef Walter <stefw gnome org>
Date:   Wed Nov 14 10:35:13 2012 +0100

    Fix collection creation bugs in mock service
    
     * Guarantee that collections have unique paths
     * Set the alias of new collections correctly
    
    https://bugzilla.gnome.org/show_bug.cgi?id=688165

 libsecret/tests/mock/service.py |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/libsecret/tests/mock/service.py b/libsecret/tests/mock/service.py
index d5a4976..2d6b580 100644
--- a/libsecret/tests/mock/service.py
+++ b/libsecret/tests/mock/service.py
@@ -315,7 +315,7 @@ class SecretCollection(dbus.service.Object):
 	def __init__(self, service, identifier=None, label="Collection", locked=False,
 	             confirm=False, master=None):
 		if identifier is None:
-			identifier = label
+			identifier = next_identifier(label)
 		identifier = encode_identifier(identifier)
 		self.service = service
 		self.identifier = identifier
@@ -627,6 +627,8 @@ class SecretService(dbus.service.Object):
 		service = self
 		def prompt_callback():
 			collection = SecretCollection(service, None, label, locked=False, confirm=True)
+			if alias:
+				collection.add_alias(alias)
 			return dbus.ObjectPath(collection.path, variant_level=1)
 		prompt = SecretPrompt(self, sender, dismiss=False, action=prompt_callback)
 		return (dbus.ObjectPath("/"), dbus.ObjectPath(prompt.path))



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]