Merge lp:~leonardr/launchpadlib/correct-test-failure into lp:launchpadlib

Proposed by Leonard Richardson
Status: Merged
Merged at revision: 105
Proposed branch: lp:~leonardr/launchpadlib/correct-test-failure
Merge into: lp:launchpadlib
Diff against target: 40 lines (+9/-3)
3 files modified
src/launchpadlib/NEWS.txt (+6/-1)
src/launchpadlib/__init__.py (+1/-1)
src/launchpadlib/docs/introduction.txt (+2/-1)
To merge this branch: bzr merge lp:~leonardr/launchpadlib/correct-test-failure
Reviewer Review Type Date Requested Status
Gary Poster Approve
j.c.sackett (community) code* Approve
Curtis Hovey Pending
Review via email: mp+45370@code.launchpad.net

Description of the change

This branch corrects a test failure that doesn't show up locally or on an EC2 instance, but which does break buildbot. In introduction.txt, we call TestLaunchpad.login_anonymously(). TestLaunchpad is supposed to go against the 'test_dev' server, and if you invoke the TestLaunchpad constructor it does by default, but I didn't define overrides for all the helper methods. So TestLaunchpad.login_anonymously("application") doesn't go against test_dev: it goes against staging.

This is fine locally and on EC2, unless staging happens to be down. But code running on buildbot is prohibited from making external network requests, so the test fails with a cryptic httplib2 error.

I will do some more work on a more elegant solution, but simply changing the test should solve the problem. The login_anonymously() call is the only time we call one of the convenience methods of TestLaunchpad instead of using the constructor. (All the unit tests use NoNetworkLaunchpad.)

To post a comment you must log in.
Revision history for this message
j.c.sackett (jcsackett) wrote :

This looks good to me.

review: Approve (code*)
Revision history for this message
Gary Poster (gary) wrote :

(I'm stepping in so we can get out of testfix mode faster.)

Thank you, looks good.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/launchpadlib/NEWS.txt'
--- src/launchpadlib/NEWS.txt 2011-01-04 18:54:10 +0000
+++ src/launchpadlib/NEWS.txt 2011-01-06 13:56:40 +0000
@@ -2,7 +2,12 @@
2NEWS for launchpadlib2NEWS for launchpadlib
3=====================3=====================
44
51.9.0 (Unreleased)51.9.1 (2011-01-06)
6==================
7
8- Corrected a test failure.
9
101.9.0 (2011-01-05)
6==================11==================
712
8- When an authorization token expires or becomes invalid, attempt to13- When an authorization token expires or becomes invalid, attempt to
914
=== modified file 'src/launchpadlib/__init__.py'
--- src/launchpadlib/__init__.py 2010-12-23 20:43:10 +0000
+++ src/launchpadlib/__init__.py 2011-01-06 13:56:40 +0000
@@ -14,4 +14,4 @@
14# You should have received a copy of the GNU Lesser General Public License14# You should have received a copy of the GNU Lesser General Public License
15# along with launchpadlib. If not, see <http://www.gnu.org/licenses/>.15# along with launchpadlib. If not, see <http://www.gnu.org/licenses/>.
1616
17__version__ = '1.9.0'17__version__ = '1.9.1'
1818
=== modified file 'src/launchpadlib/docs/introduction.txt'
--- src/launchpadlib/docs/introduction.txt 2011-01-04 20:31:27 +0000
+++ src/launchpadlib/docs/introduction.txt 2011-01-06 13:56:40 +0000
@@ -190,7 +190,8 @@
190setting up a web service connection in one function call. All you have190setting up a web service connection in one function call. All you have
191to provide is the consumer name.191to provide is the consumer name.
192192
193 >>> launchpad = Launchpad.login_anonymously('launchpad-library')193 >>> launchpad = Launchpad.login_anonymously(
194 ... 'launchpad-library', service_root="test_dev")
194 >>> sorted(launchpad.people)195 >>> sorted(launchpad.people)
195 [...]196 [...]
196197

Subscribers

People subscribed via source and target branches