Merge lp:~mandel/ubuntuone-control-panel/add-app-name into lp:ubuntuone-control-panel

Proposed by Manuel de la Peña
Status: Merged
Approved by: Natalia Bidart
Approved revision: 283
Merged at revision: 285
Proposed branch: lp:~mandel/ubuntuone-control-panel/add-app-name
Merge into: lp:ubuntuone-control-panel
Diff against target: 43 lines (+7/-2)
2 files modified
ubuntuone/controlpanel/tests/test_web_client.py (+5/-0)
ubuntuone/controlpanel/web_client.py (+2/-2)
To merge this branch: bzr merge lp:~mandel/ubuntuone-control-panel/add-app-name
Reviewer Review Type Date Requested Status
Natalia Bidart Approve
Diego Sarmentero (community) Approve
Review via email: mp+97071@code.launchpad.net

Commit message

- Added the app name from ubuntu one to be used in the webclient so that it is shown in the sso ui (LP: #952880).

Description of the change

- Added the app name from ubuntu one to be used in the webclient so that it is shown in the sso ui (LP: #952880).

To post a comment you must log in.
Revision history for this message
Diego Sarmentero (diegosarmentero) wrote :

needs tests

review: Needs Fixing
283. By Manuel de la Peña

Added test to ensure that the correct app name is used.

Revision history for this message
Diego Sarmentero (diegosarmentero) wrote :

+1

review: Approve
Revision history for this message
Natalia Bidart (nataliabidart) wrote :

Looks good, though the platform import is out of order :-).

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'ubuntuone/controlpanel/tests/test_web_client.py'
2--- ubuntuone/controlpanel/tests/test_web_client.py 2012-03-05 12:36:56 +0000
3+++ ubuntuone/controlpanel/tests/test_web_client.py 2012-03-13 11:29:19 +0000
4@@ -29,6 +29,7 @@
5 WebClient,
6 WebClientError,
7 )
8+from ubuntuone.platform.credentials import APP_NAME
9
10
11 SAMPLE_KEY = "result"
12@@ -104,6 +105,10 @@
13 self.wc = WebClient(sample_get_credentials, base_url=self.base_iri)
14 self.addCleanup(self.wc.shutdown)
15
16+ def test_correct_app_name(self):
17+ """Assert that the wc uses the correct appname."""
18+ self.assertEqual(APP_NAME, self.wc.wc.appname)
19+
20 @defer.inlineCallbacks
21 def test_get_url(self):
22 """A method is successfully called in the mock webservice."""
23
24=== modified file 'ubuntuone/controlpanel/web_client.py'
25--- ubuntuone/controlpanel/web_client.py 2012-02-06 16:28:26 +0000
26+++ ubuntuone/controlpanel/web_client.py 2012-03-13 11:29:19 +0000
27@@ -30,7 +30,7 @@
28
29 from ubuntuone.controlpanel import WEBSERVICE_BASE_URL
30 from ubuntuone.controlpanel.logger import setup_logging
31-
32+from ubuntuone.platform.credentials import APP_NAME
33
34 logger = setup_logging('webclient')
35
36@@ -42,7 +42,7 @@
37 """Initialize the webclient."""
38 self.base_url = base_url
39 self.get_credentials = get_credentials
40- self.wc = webclient_factory()
41+ self.wc = webclient_factory(APP_NAME)
42 logger.debug("WebClient created: base_url is %r, inner client is %r.",
43 self.base_url, self.wc)
44

Subscribers

People subscribed via source and target branches

to all changes: