From 4eb3c4577e16feb74870c023eaaa474bc7490a1a Mon Sep 17 00:00:00 2001 From: Stef Walter Date: Wed, 14 Nov 2012 10:35:13 +0100 Subject: [PATCH] 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 file changed, 3 insertions(+), 1 deletion(-) 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)) -- 2.7.4