← Back to team overview

launchpad-reviewers team mailing list archive

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

 

Benji York has proposed merging lp:~benji/launchpad/test-bugs into lp:launchpad.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~benji/launchpad/test-bugs/+merge/97975

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
-- 
https://code.launchpad.net/~benji/launchpad/test-bugs/+merge/97975
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~benji/launchpad/test-bugs into lp:launchpad.
=== modified file 'lib/lp/archiveuploader/tests/test_uploadprocessor.py'
--- lib/lp/archiveuploader/tests/test_uploadprocessor.py	2012-01-20 15:42:44 +0000
+++ lib/lp/archiveuploader/tests/test_uploadprocessor.py	2012-03-16 20:05:22 +0000
@@ -625,9 +625,10 @@
 
         # Check it went ok to the NEW queue and all is going well so far.
         from_addr, to_addrs, raw_msg = stub.test_emails.pop()
+        to_addrs = [e.strip() for e in to_addrs]
         foo_bar = "Foo Bar <foo.bar@xxxxxxxxxxxxx>"
         daniel = "Daniel Silverstone <daniel.silverstone@xxxxxxxxxxxxx>"
-        self.assertEqual([e.strip() for e in to_addrs], [foo_bar, daniel])
+        self.assertContentEqual(to_addrs, [foo_bar, daniel])
         self.assertTrue(
             "NEW" in raw_msg, "Expected email containing 'NEW', got:\n%s"
             % raw_msg)
@@ -659,9 +660,10 @@
 
         # Verify we get an email talking about awaiting approval.
         from_addr, to_addrs, raw_msg = stub.test_emails.pop()
+        to_addrs = [e.strip() for e in to_addrs]
         daniel = "Daniel Silverstone <daniel.silverstone@xxxxxxxxxxxxx>"
         foo_bar = "Foo Bar <foo.bar@xxxxxxxxxxxxx>"
-        self.assertEqual([e.strip() for e in to_addrs], [foo_bar, daniel])
+        self.assertContentEqual(to_addrs, [foo_bar, daniel])
         self.assertTrue("Waiting for approval" in raw_msg,
                         "Expected an 'upload awaits approval' email.\n"
                         "Got:\n%s" % raw_msg)