Merge lp:~benji/launchpad/test-bugs into lp:launchpad

Proposed by Benji York on 2012-03-16
Status: Merged
Approved by: Curtis Hovey on 2012-03-16
Approved revision: no longer in the source branch.
Merged at revision: 14966
Proposed branch: lp:~benji/launchpad/test-bugs
Merge into: lp:launchpad
Diff against target: 27 lines (+4/-2)
1 file modified
lib/lp/archiveuploader/tests/test_uploadprocessor.py (+4/-2)
To merge this branch: bzr merge lp:~benji/launchpad/test-bugs
Reviewer Review Type Date Requested Status
Curtis Hovey (community) code 2012-03-16 Approve on 2012-03-16
Review via email: mp+97975@code.launchpad.net

Commit Message

replace two uses of assertEqual with assertContentsEqual to fix spurious test failures

Description of the Change

When some of the tests are run individually, ordering problems arise. This branch replaces two uses of assertEqual with assertContentsEqual to fix those spurious test failures.

lint: the lint report is clean

tests: the modified tests can be run with bin/test -c -t test_uploadprocessor

To post a comment you must log in.
Curtis Hovey (sinzui) wrote :

Thank you.

review: Approve (code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/lp/archiveuploader/tests/test_uploadprocessor.py'
2--- lib/lp/archiveuploader/tests/test_uploadprocessor.py 2012-01-20 15:42:44 +0000
3+++ lib/lp/archiveuploader/tests/test_uploadprocessor.py 2012-03-16 20:08:18 +0000
4@@ -625,9 +625,10 @@
5
6 # Check it went ok to the NEW queue and all is going well so far.
7 from_addr, to_addrs, raw_msg = stub.test_emails.pop()
8+ to_addrs = [e.strip() for e in to_addrs]
9 foo_bar = "Foo Bar <foo.bar@canonical.com>"
10 daniel = "Daniel Silverstone <daniel.silverstone@canonical.com>"
11- self.assertEqual([e.strip() for e in to_addrs], [foo_bar, daniel])
12+ self.assertContentEqual(to_addrs, [foo_bar, daniel])
13 self.assertTrue(
14 "NEW" in raw_msg, "Expected email containing 'NEW', got:\n%s"
15 % raw_msg)
16@@ -659,9 +660,10 @@
17
18 # Verify we get an email talking about awaiting approval.
19 from_addr, to_addrs, raw_msg = stub.test_emails.pop()
20+ to_addrs = [e.strip() for e in to_addrs]
21 daniel = "Daniel Silverstone <daniel.silverstone@canonical.com>"
22 foo_bar = "Foo Bar <foo.bar@canonical.com>"
23- self.assertEqual([e.strip() for e in to_addrs], [foo_bar, daniel])
24+ self.assertContentEqual(to_addrs, [foo_bar, daniel])
25 self.assertTrue("Waiting for approval" in raw_msg,
26 "Expected an 'upload awaits approval' email.\n"
27 "Got:\n%s" % raw_msg)