Merge lp:~dobey/ubuntu-sso-client/fix-805244 into lp:ubuntu-sso-client

Proposed by dobey
Status: Merged
Approved by: dobey
Approved revision: 732
Merged at revision: 732
Proposed branch: lp:~dobey/ubuntu-sso-client/fix-805244
Merge into: lp:ubuntu-sso-client
Diff against target: 51 lines (+19/-4)
2 files modified
ubuntu_sso/utils/tests/test_txsecrets.py (+11/-0)
ubuntu_sso/utils/txsecrets.py (+8/-4)
To merge this branch: bzr merge lp:~dobey/ubuntu-sso-client/fix-805244
Reviewer Review Type Date Requested Status
Natalia Bidart (community) Approve
Review via email: mp+66918@code.launchpad.net

Commit message

Support the new API signature for CreateCollection as well

To post a comment you must log in.
Revision history for this message
Natalia Bidart (nataliabidart) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'ubuntu_sso/utils/tests/test_txsecrets.py'
2--- ubuntu_sso/utils/tests/test_txsecrets.py 2011-06-23 17:50:51 +0000
3+++ ubuntu_sso/utils/tests/test_txsecrets.py 2011-07-05 15:31:33 +0000
4@@ -371,6 +371,17 @@
5 clxn_label_property = txsecrets.CLXN_LABEL_PROPERTY
6 collections_property = txsecrets.COLLECTIONS_PROPERTY
7
8+ # pylint: disable=W0221
9+ @dbus.service.method(dbus_interface=txsecrets.SERVICE_IFACE,
10+ in_signature="a{sv}s", out_signature="oo")
11+ def CreateCollection(self, properties, alias):
12+ """Create a new collection with the specified properties."""
13+ collection, prompt = super(AltSecretServiceMock,
14+ self).CreateCollection(properties)
15+ self.SetAlias(alias, collection)
16+ return collection, prompt
17+ # pylint: enable=W0221
18+
19
20 def create_object_path(base):
21 """Create a random object path given a base path."""
22
23=== modified file 'ubuntu_sso/utils/txsecrets.py'
24--- ubuntu_sso/utils/txsecrets.py 2011-06-23 13:43:39 +0000
25+++ ubuntu_sso/utils/txsecrets.py 2011-07-05 15:31:33 +0000
26@@ -157,7 +157,7 @@
27 d.addCallback(self.make_item_list)
28 return d
29
30- def create_collection(self, label):
31+ def create_collection(self, label, alias=''):
32 """Create a new collection with the specified properties."""
33 d = Deferred()
34
35@@ -180,9 +180,13 @@
36
37 properties = {CLXN_LABEL_PROPERTY: dbus.String(label,
38 variant_level=1)}
39- self.service.CreateCollection(properties,
40- reply_handler=createcollection_handler,
41- error_handler=error_fallback)
42+ try:
43+ self.service.CreateCollection(
44+ properties, alias,
45+ reply_handler=createcollection_handler,
46+ error_handler=error_fallback)
47+ except TypeError:
48+ error_fallback(None)
49
50 d.addCallback(lambda p: Collection(self, p))
51 return d

Subscribers

People subscribed via source and target branches