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 (community) 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
=== modified file 'ubuntuone/controlpanel/tests/test_web_client.py'
--- ubuntuone/controlpanel/tests/test_web_client.py 2012-03-05 12:36:56 +0000
+++ ubuntuone/controlpanel/tests/test_web_client.py 2012-03-13 11:29:19 +0000
@@ -29,6 +29,7 @@
29 WebClient,29 WebClient,
30 WebClientError,30 WebClientError,
31)31)
32from ubuntuone.platform.credentials import APP_NAME
3233
3334
34SAMPLE_KEY = "result"35SAMPLE_KEY = "result"
@@ -104,6 +105,10 @@
104 self.wc = WebClient(sample_get_credentials, base_url=self.base_iri)105 self.wc = WebClient(sample_get_credentials, base_url=self.base_iri)
105 self.addCleanup(self.wc.shutdown)106 self.addCleanup(self.wc.shutdown)
106107
108 def test_correct_app_name(self):
109 """Assert that the wc uses the correct appname."""
110 self.assertEqual(APP_NAME, self.wc.wc.appname)
111
107 @defer.inlineCallbacks112 @defer.inlineCallbacks
108 def test_get_url(self):113 def test_get_url(self):
109 """A method is successfully called in the mock webservice."""114 """A method is successfully called in the mock webservice."""
110115
=== modified file 'ubuntuone/controlpanel/web_client.py'
--- ubuntuone/controlpanel/web_client.py 2012-02-06 16:28:26 +0000
+++ ubuntuone/controlpanel/web_client.py 2012-03-13 11:29:19 +0000
@@ -30,7 +30,7 @@
3030
31from ubuntuone.controlpanel import WEBSERVICE_BASE_URL31from ubuntuone.controlpanel import WEBSERVICE_BASE_URL
32from ubuntuone.controlpanel.logger import setup_logging32from ubuntuone.controlpanel.logger import setup_logging
3333from ubuntuone.platform.credentials import APP_NAME
3434
35logger = setup_logging('webclient')35logger = setup_logging('webclient')
3636
@@ -42,7 +42,7 @@
42 """Initialize the webclient."""42 """Initialize the webclient."""
43 self.base_url = base_url43 self.base_url = base_url
44 self.get_credentials = get_credentials44 self.get_credentials = get_credentials
45 self.wc = webclient_factory()45 self.wc = webclient_factory(APP_NAME)
46 logger.debug("WebClient created: base_url is %r, inner client is %r.",46 logger.debug("WebClient created: base_url is %r, inner client is %r.",
47 self.base_url, self.wc)47 self.base_url, self.wc)
4848

Subscribers

People subscribed via source and target branches

to all changes: