Merge lp:~leonardr/launchpad/launchpadlib-integration into lp:launchpad

Proposed by Leonard Richardson
Status: Merged
Merged at revision: 12167
Proposed branch: lp:~leonardr/launchpad/launchpadlib-integration
Merge into: lp:launchpad
Diff against target: 84 lines (+13/-7)
4 files modified
lib/canonical/launchpad/pagetests/webservice/launchpadlib.txt (+6/-3)
lib/lp/testing/_webservice.py (+2/-2)
setup.py (+2/-0)
versions.cfg (+3/-2)
To merge this branch: bzr merge lp:~leonardr/launchpad/launchpadlib-integration
Reviewer Review Type Date Requested Status
Māris Fogels (community) Approve
Review via email: mp+45174@code.launchpad.net

Description of the change

This branch makes some minor changes to launchpadlib that I made while integrating my branch https://code.launchpad.net/~leonardr/launchpadlib/separate-login-for-cronjob into Launchpad.

* Bumped the version number.
* Removed a doctest of login(), since the method is deprecated (and it now has a unit test).
* Made the TestableLaunchpad class provide default values for credential_store and authorization_engine.
* Changed the KnownTokens convenience class to pass in a Credentials object into the TestableLaunchpad constructor, rather than using the now-deprecated login() method.

To post a comment you must log in.
Revision history for this message
Leonard Richardson (leonardr) wrote :

Sorry, this is the wrong branch for that MP. Here's the real MP.

This branch makes some minor changes to launchpadlib that I made while integrating my branch https://code.launchpad.net/~leonardr/launchpadlib/launchpad-integration into Launchpad.

* Require new versions of launchpadlib and lazr.restfulclient
* Require the 'keyring' module, a new dependency of launchpadlib
* Many tests invoke the Launchpad constructor, which now takes two new arguments (a token authorization engine and a credential store). These tests don't need either, which is why they're invoking the constructor instead of using login_with(). I changed the tests to pass in None for those two arguments.

Revision history for this message
Māris Fogels (mars) wrote :

Hi Leonard,

This change looks good to me. +1, r=mars

Maris

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'lib/canonical/launchpad/pagetests/webservice/launchpadlib.txt'
--- lib/canonical/launchpad/pagetests/webservice/launchpadlib.txt 2010-08-12 16:40:04 +0000
+++ lib/canonical/launchpad/pagetests/webservice/launchpadlib.txt 2011-01-05 19:12:20 +0000
@@ -48,7 +48,8 @@
48scheme which does not work in the test environment.48scheme which does not work in the test environment.
4949
50 >>> from launchpadlib.launchpad import Launchpad50 >>> from launchpadlib.launchpad import Launchpad
51 >>> launchpad = Launchpad(credentials, 'http://api.launchpad.dev/')51 >>> launchpad = Launchpad(
52 ... credentials, None, None, 'http://api.launchpad.dev/')
52 >>> print launchpad.me.name53 >>> print launchpad.me.name
53 no-priv54 no-priv
5455
@@ -94,7 +95,8 @@
94Now create a Launchpad object and observe how it populates the cache.95Now create a Launchpad object and observe how it populates the cache.
9596
96 >>> launchpad = Launchpad(97 >>> launchpad = Launchpad(
97 ... credentials, 'http://api.launchpad.dev/', cache=cache)98 ... credentials, None, None, 'http://api.launchpad.dev/',
99 ... cache=cache)
98 send: 'GET /1.0/ ...accept: application/vnd.sun.wadl+xml...'100 send: 'GET /1.0/ ...accept: application/vnd.sun.wadl+xml...'
99 reply: 'HTTP/1.0 200 Ok\n'101 reply: 'HTTP/1.0 200 Ok\n'
100 ...102 ...
@@ -106,7 +108,8 @@
106used instead of new HTTP requests being used.108used instead of new HTTP requests being used.
107109
108 >>> launchpad = Launchpad(110 >>> launchpad = Launchpad(
109 ... credentials, 'http://api.launchpad.dev/', cache=cache)111 ... credentials, None, None, 'http://api.launchpad.dev/',
112 ... cache=cache)
110113
111Cleanup.114Cleanup.
112115
113116
=== modified file 'lib/lp/testing/_webservice.py'
--- lib/lp/testing/_webservice.py 2011-01-04 13:34:53 +0000
+++ lib/lp/testing/_webservice.py 2011-01-05 19:12:20 +0000
@@ -145,8 +145,8 @@
145 version = version or Launchpad.DEFAULT_VERSION145 version = version or Launchpad.DEFAULT_VERSION
146 cache = tempfile.mkdtemp(prefix='launchpadlib-cache-')146 cache = tempfile.mkdtemp(prefix='launchpadlib-cache-')
147 zope.testing.cleanup.addCleanUp(_clean_up_cache, (cache,))147 zope.testing.cleanup.addCleanUp(_clean_up_cache, (cache,))
148 return TestLaunchpad(148 return TestLaunchpad(credentials, None, None, service_root=service_root,
149 credentials, service_root, version=version, cache=cache)149 version=version, cache=cache)
150150
151151
152class TestLaunchpad(Launchpad):152class TestLaunchpad(Launchpad):
153153
=== modified file 'setup.py'
--- setup.py 2010-12-01 11:26:57 +0000
+++ setup.py 2011-01-05 19:12:20 +0000
@@ -47,6 +47,8 @@
47 'lazr.testing',47 'lazr.testing',
48 'lazr.uri',48 'lazr.uri',
49 'lazr-js',49 'lazr-js',
50 # Required for launchpadlib
51 'keyring',
50 'manuel',52 'manuel',
51 'mechanize',53 'mechanize',
52 'meliae',54 'meliae',
5355
=== modified file 'versions.cfg'
--- versions.cfg 2010-12-10 20:22:14 +0000
+++ versions.cfg 2011-01-05 19:12:20 +0000
@@ -24,7 +24,8 @@
24grokcore.component = 1.624grokcore.component = 1.6
25httplib2 = 0.6.025httplib2 = 0.6.0
26ipython = 0.9.126ipython = 0.9.1
27launchpadlib = 1.6.527keyring = 0.5
28launchpadlib = 1.9.0
28lazr.authentication = 0.1.129lazr.authentication = 0.1.1
29lazr.batchnavigator = 1.2.230lazr.batchnavigator = 1.2.2
30lazr.config = 1.1.331lazr.config = 1.1.3
@@ -32,7 +33,7 @@
32lazr.enum = 1.1.233lazr.enum = 1.1.2
33lazr.lifecycle = 1.134lazr.lifecycle = 1.1
34lazr.restful = 0.15.035lazr.restful = 0.15.0
35lazr.restfulclient = 0.10.036lazr.restfulclient = 0.11.1
36lazr.smtptest = 1.137lazr.smtptest = 1.1
37lazr.testing = 0.1.138lazr.testing = 0.1.1
38lazr.uri = 1.0.239lazr.uri = 1.0.2