Merge lp:~jameinel/launchpad/py27-xmlrpc-auth-1019292 into lp:launchpad
| Status: | Merged | ||||
|---|---|---|---|---|---|
| Approved by: | Brad Crittenden on 2012-06-29 | ||||
| Approved revision: | no longer in the source branch. | ||||
| Merged at revision: | 15538 | ||||
| Proposed branch: | lp:~jameinel/launchpad/py27-xmlrpc-auth-1019292 | ||||
| Merge into: | lp:launchpad | ||||
| Diff against target: |
389 lines (+195/-170) 4 files modified
lib/lp/testing/xmlrpc.py (+4/-1) lib/lp/xmlrpc/tests/test_doc.py (+0/-18) lib/lp/xmlrpc/tests/test_private_xmlrpc.py (+91/-68) lib/lp/xmlrpc/tests/test_xmlrpc_selftest.py (+100/-83) |
||||
| To merge this branch: | bzr merge lp:~jameinel/launchpad/py27-xmlrpc-auth-1019292 | ||||
| Related bugs: |
|
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Brad Crittenden (community) | code | 2012-06-29 | Approve on 2012-06-29 |
|
Review via email:
|
|||
Commit Message
Fix XMLRPC Authentication for python-2.7
Description of the Change
= Summary =
This fixes another python-2.7 vs 2.6 change in XMLRPC.
Specifically, we have a wrapper that avoids having to set up a real XMLRPC
server and talking to it (XMLRPCTestTran
However, it overrode a function that changed in 2.7. This specific fix is
because 'make_connection' in 2.7 now has a side effect of parsing the
extra headers that need to be passed to the server. Without them, you lose
the authentication information.
== Proposed fix ==
In 2.7 make_connection just saves the extra headers as
'self._
extra attribute that will be ignored.
== LOC Rationale ==
This adds about 30 LoC. However the bulk of this is moving all of the doc
tests over to be unittests. Which should be more maintainable. (It
certainly was easier to debug the failure, since I could step around with
pdb.)
== Tests ==
No new tests added, just moved from doc tests to unit tests.
bin/test -vvv -m lp.xmlrpc.tests
Should run the test suite for this.
== Demo and Q/A ==
This seems to all be test-suite infrastructure, so the QA is 'do the tests
pass, even on python-2.7'.

Hi John,
Thanks for the fix and going the extra step to convert to a unit test.
Rather than login(ANONYMOUS) I think using a with statement with the 'person_logged_in' context manager is cleaner.
typo: hello() returns Anonymous
Otherwise it looks good.