Hi Gary, This branch looks good. I only have suggestions for minor changes and fixing the lint items that are possible. merge-conditional -Edwin {{{ = Launchpad lint = == Pyflakes notices == lib/canonical/launchpad/testing/pages.py 28: 'urlparse' imported but unused lib/canonical/testing/layers.py 75: 'HTTPPublication' imported but unused Traceback (most recent call last): File "/usr/bin/pyflakes", line 5, in sys.exit(main(sys.argv[1:])) File "/usr/lib/python2.6/dist-packages/pyflakes/scripts/pyflakes.py", line 57, in main warnings += checkPath(arg) TypeError unsupported operand type(s) for +=: 'int' and 'NoneType' == Pylint notices == lib/lazr/__init__.py 1: [F0001] No module named lib/lazr/__init__ lib/canonical/launchpad/testing/pages.py 621: [C0301] Line too long (79/78) 42: [F0401] Unable to import 'lazr.restful.testing.webservice' (No module named restful) 55: [E1002, UnstickyCookieHTTPCaller.__init__] Use super on an old style class 63: [E1002, UnstickyCookieHTTPCaller.__call__] Use super on an old style class 71: [E1002, UnstickyCookieHTTPCaller.chooseRequestClass] Use super on an old style class 28: [W0611] Unused import urlparse lib/canonical/testing/layers.py 75: [W0611] Unused import HTTPPublication }}} >=== modified file 'lib/canonical/launchpad/pagetests/webservice/root.txt' >--- lib/canonical/launchpad/pagetests/webservice/root.txt 2009-03-18 17:20:01 +0000 >+++ lib/canonical/launchpad/pagetests/webservice/root.txt 2009-08-26 22:51:00 +0000 >@@ -5,9 +5,8 @@ > confusion when one program runs as different users, this is > implemented as a redirect to that person's canonical URL. > >- >>> print webservice.get('/people/+me').getOutput() >+ >>> print webservice.get('/people/+me') > HTTP/1.1 303 See Other > ... > Location: http://.../~salgado > ... >- > >=== modified file 'lib/canonical/launchpad/pagetests/webservice/xx-hwdb.txt' >--- lib/canonical/launchpad/pagetests/webservice/xx-hwdb.txt 2009-08-14 13:03:36 +0000 >+++ lib/canonical/launchpad/pagetests/webservice/xx-hwdb.txt 2009-08-26 22:51:00 +0000 >@@ -537,7 +537,7 @@ > Accessing the raw submission data yields a redirect to a Librarian URL. > > >>> print webservice.get(submission['raw_submission_link']) >- HTTP/1.1 303 See Other >+ HTTP/1.1 303 See Other... > Content-Length: 0 > Content-Type: text/plain > Location: http://localhost:58000/92/sample-submission-2.xml >@@ -769,7 +769,7 @@ > > A vendor ID can be accessed by via its database ID. > >- >>> vendor_id = webservice.get('+hwdb/+hwvendorid/1').jsonBody() >+ >>> vendor_id = webservice.get('/+hwdb/+hwvendorid/1').jsonBody() > >>> pprint_entry(vendor_id) > bus: u'System' > id: 1 > >=== modified file 'lib/canonical/launchpad/pagetests/webservice/xx-person.txt' >--- lib/canonical/launchpad/pagetests/webservice/xx-person.txt 2009-08-13 15:12:16 +0000 >+++ lib/canonical/launchpad/pagetests/webservice/xx-person.txt 2009-08-26 22:51:00 +0000 >@@ -387,7 +387,7 @@ > ... u'wikiname': 'MrExample'} > >>> response = webservice.patch( > ... wiki_name['self_link'], 'application/json', dumps(patch)) >- >>> print response.getOutput() >+ >>> print response > HTTP/1.1 400 Bad Request > ... > wiki: The URI scheme "javascript" is not allowed. > >=== modified file 'lib/canonical/launchpad/pagetests/webservice/xx-private-membership.txt' >--- lib/canonical/launchpad/pagetests/webservice/xx-private-membership.txt 2009-07-15 09:42:45 +0000 >+++ lib/canonical/launchpad/pagetests/webservice/xx-private-membership.txt 2009-08-26 22:51:00 +0000 >@@ -101,7 +101,7 @@ > ... simplejson.dumps(representation), > ... headers) > >- >>> print modify_team('~my-new-team', {'visibility' : 'Private Membership'}, >+ >>> print modify_team('/~my-new-team', {'visibility' : 'Private Membership'}, Line too long. > ... 'PATCH', comm_webservice) > HTTP/1.1 209 Content Returned > ... >@@ -116,7 +116,7 @@ > > As an admin, Salgado can also change the team's visibility. > >- >>> print modify_team('~my-new-team', {'visibility' : 'Public'}, >+ >>> print modify_team('/~my-new-team', {'visibility' : 'Public'}, > ... 'PATCH', webservice) > HTTP/1.1 209 Content Returned > ... >@@ -131,7 +131,7 @@ > > An unprivileged user is not able to change the visibility. > >- >>> print modify_team('~my-new-team', {'visibility' : 'Private Membership'}, >+ >>> print modify_team('/~my-new-team', {'visibility' : 'Private Membership'}, Line too long. > ... 'PATCH', user_webservice) > HTTP/1.1 401 Unauthorized > ... > >=== modified file 'lib/canonical/launchpad/pagetests/webservice/xx-project-registry.txt' >--- lib/canonical/launchpad/pagetests/webservice/xx-project-registry.txt 2009-08-13 15:12:16 +0000 >+++ lib/canonical/launchpad/pagetests/webservice/xx-project-registry.txt 2009-08-26 22:51:00 +0000 >@@ -173,10 +173,8 @@ > name. As a convenience, requests for projects using the wrong case > are redirected to the correct location. > >- >>> firefox = webservice.get('/FireFox').jsonBody() >- Traceback (most recent call last): >- ... >- ValueError: HTTP/1.1 301 Moved Permanently >+ >>> print webservice.get('/FireFox') >+ HTTP/1.1 301 Moved Permanently > ... > Location: http://api.launchpad.dev/beta/firefox > ... >@@ -578,15 +576,17 @@ > Mega Money Maker > > The use of "licensing_search" is restricted to commercial admins. >-Attempting to access it as a normal users results in an exception. >+Attempting to access it as a normal users is unauthorized. > >- >>> proprietary = user_webservice.named_get( >+ >>> print user_webservice.named_get( > ... "/projects", "licensing_search", >- ... licenses=["Other/Proprietary"]).jsonBody() >+ ... licenses=["Other/Proprietary"]) >+ HTTP/1.1 401 Unauthorized >+ ... > Traceback (most recent call last): > ... >- ValueError: HTTP/1.1 401 Unauthorized >- ... >+ Unauthorized: (...) >+ > > > > > The project collection has a method for creating a new project. > >@@ -996,14 +996,14 @@ > >>> url = '/firefox/trunk/0.9.2/+file/firefox-0.9.2.orig.tar.gz/file' > >>> response = webservice.put(url, 'application/x-tar-gz', 'fakefiledata') > >>> print response >- HTTP/1.1 405 Method Not Allowed >+ HTTP/1.1 405 Method Not Allowed... > Allow: GET > ... > > >>> url = '/firefox/trunk/0.9.2/+file/firefox-0.9.2.orig.tar.gz/signature' > >>> response = webservice.put(url, 'pgpapplication/data', 'signaturedata') > >>> print response >- HTTP/1.1 405 Method Not Allowed >+ HTTP/1.1 405 Method Not Allowed... > Allow: GET > ... > > >=== modified file 'lib/canonical/launchpad/pagetests/webservice/xx-service.txt' >--- lib/canonical/launchpad/pagetests/webservice/xx-service.txt 2009-07-16 22:15:11 +0000 >+++ lib/canonical/launchpad/pagetests/webservice/xx-service.txt 2009-08-26 22:51:00 +0000 >@@ -77,6 +77,7 @@ > request to http://api.launchpad.net/beta/, but with the links pointing > to a different host. > >+ >>> webservice.domain = 'bugs.launchpad.dev' > >>> root = webservice.get( > ... 'http://bugs.launchpad.dev/api/beta/').jsonBody() > >>> print root['people_collection_link'] >@@ -87,7 +88,8 @@ > > >>> from canonical.launchpad.testing.pages import ( > ... LaunchpadWebServiceCaller) >- >>> noauth_webservice = LaunchpadWebServiceCaller() >+ >>> noauth_webservice = LaunchpadWebServiceCaller( >+ ... domain='bugs.launchpad.dev') > >>> sample_auth = 'Basic %s' % '