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
1=== modified file 'lib/canonical/launchpad/pagetests/webservice/launchpadlib.txt'
2--- lib/canonical/launchpad/pagetests/webservice/launchpadlib.txt 2010-08-12 16:40:04 +0000
3+++ lib/canonical/launchpad/pagetests/webservice/launchpadlib.txt 2011-01-05 19:12:20 +0000
4@@ -48,7 +48,8 @@
5 scheme which does not work in the test environment.
6
7 >>> from launchpadlib.launchpad import Launchpad
8- >>> launchpad = Launchpad(credentials, 'http://api.launchpad.dev/')
9+ >>> launchpad = Launchpad(
10+ ... credentials, None, None, 'http://api.launchpad.dev/')
11 >>> print launchpad.me.name
12 no-priv
13
14@@ -94,7 +95,8 @@
15 Now create a Launchpad object and observe how it populates the cache.
16
17 >>> launchpad = Launchpad(
18- ... credentials, 'http://api.launchpad.dev/', cache=cache)
19+ ... credentials, None, None, 'http://api.launchpad.dev/',
20+ ... cache=cache)
21 send: 'GET /1.0/ ...accept: application/vnd.sun.wadl+xml...'
22 reply: 'HTTP/1.0 200 Ok\n'
23 ...
24@@ -106,7 +108,8 @@
25 used instead of new HTTP requests being used.
26
27 >>> launchpad = Launchpad(
28- ... credentials, 'http://api.launchpad.dev/', cache=cache)
29+ ... credentials, None, None, 'http://api.launchpad.dev/',
30+ ... cache=cache)
31
32 Cleanup.
33
34
35=== modified file 'lib/lp/testing/_webservice.py'
36--- lib/lp/testing/_webservice.py 2011-01-04 13:34:53 +0000
37+++ lib/lp/testing/_webservice.py 2011-01-05 19:12:20 +0000
38@@ -145,8 +145,8 @@
39 version = version or Launchpad.DEFAULT_VERSION
40 cache = tempfile.mkdtemp(prefix='launchpadlib-cache-')
41 zope.testing.cleanup.addCleanUp(_clean_up_cache, (cache,))
42- return TestLaunchpad(
43- credentials, service_root, version=version, cache=cache)
44+ return TestLaunchpad(credentials, None, None, service_root=service_root,
45+ version=version, cache=cache)
46
47
48 class TestLaunchpad(Launchpad):
49
50=== modified file 'setup.py'
51--- setup.py 2010-12-01 11:26:57 +0000
52+++ setup.py 2011-01-05 19:12:20 +0000
53@@ -47,6 +47,8 @@
54 'lazr.testing',
55 'lazr.uri',
56 'lazr-js',
57+ # Required for launchpadlib
58+ 'keyring',
59 'manuel',
60 'mechanize',
61 'meliae',
62
63=== modified file 'versions.cfg'
64--- versions.cfg 2010-12-10 20:22:14 +0000
65+++ versions.cfg 2011-01-05 19:12:20 +0000
66@@ -24,7 +24,8 @@
67 grokcore.component = 1.6
68 httplib2 = 0.6.0
69 ipython = 0.9.1
70-launchpadlib = 1.6.5
71+keyring = 0.5
72+launchpadlib = 1.9.0
73 lazr.authentication = 0.1.1
74 lazr.batchnavigator = 1.2.2
75 lazr.config = 1.1.3
76@@ -32,7 +33,7 @@
77 lazr.enum = 1.1.2
78 lazr.lifecycle = 1.1
79 lazr.restful = 0.15.0
80-lazr.restfulclient = 0.10.0
81+lazr.restfulclient = 0.11.1
82 lazr.smtptest = 1.1
83 lazr.testing = 0.1.1
84 lazr.uri = 1.0.2