← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~gz/launchpad/py27_mail_header_wrapping into lp:launchpad

 

Martin Packman has proposed merging lp:~gz/launchpad/py27_mail_header_wrapping into lp:launchpad.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)
Related bugs:
  Bug #1020151 in Launchpad itself: "lp.soyuz.tests.test_packageupload fails on Python 2.7 and prints NULs in log"
  https://bugs.launchpad.net/launchpad/+bug/1020151
  Bug #1020190 in Launchpad itself: "Failure in lp.code.mail.tests.test_branchmergeproposal on Python 2.7"
  https://bugs.launchpad.net/launchpad/+bug/1020190
  Bug #1020191 in Launchpad itself: "Failure in lp.services.mail.tests.test_stub on Python 2.7"
  https://bugs.launchpad.net/launchpad/+bug/1020191

For more details, see:
https://code.launchpad.net/~gz/launchpad/py27_mail_header_wrapping/+merge/113109

Test changes required as the email header wrapping format changed slightly in Python 2.7 to using a space rather than a tab to indent.

For background see earlier merge proposal addressing the same issue in another test:

<https://code.launchpad.net/~vila/launchpad/py27-mail-header-continuation-lines/+merge/112579>

Hopefully this branch squishes all remaining occurrences.


= Launchpad lint =

Checking for conflicts and issues in changed files.

Linting changed files:
  lib/lp/code/mail/tests/test_branchmergeproposal.py
  lib/lp/services/mail/tests/test_stub.py
  lib/lp/soyuz/tests/test_packageupload.py

./lib/lp/services/mail/tests/test_stub.py
     107: E501 line too long (82 characters)
     111: E302 expected 2 blank lines, found 1

This change touches line 107, but I'm not sure how to wrap and still make the doctest pass.

-- 
https://code.launchpad.net/~gz/launchpad/py27_mail_header_wrapping/+merge/113109
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~gz/launchpad/py27_mail_header_wrapping into lp:launchpad.
=== modified file 'lib/lp/code/mail/tests/test_branchmergeproposal.py'
--- lib/lp/code/mail/tests/test_branchmergeproposal.py	2012-05-02 05:25:11 +0000
+++ lib/lp/code/mail/tests/test_branchmergeproposal.py	2012-07-02 20:16:24 +0000
@@ -493,8 +493,9 @@
                          'who were implicitly subscribed to their branches.')
         email = emails[0]
         self.assertEqual('[Merge] '
-            'lp://dev/~bob/super-product/fix-foo-for-bar into\n\t'
-            'lp://dev/~mary/super-product/bar', email['subject'])
+            'lp://dev/~bob/super-product/fix-foo-for-bar into\n'
+            ' lp://dev/~mary/super-product/bar',
+            email['subject'].replace('\n\t', '\n '))
         bmp = job.branch_merge_proposal
         expected = dedent("""\
             The proposal to merge %(source)s into %(target)s has been updated.

=== modified file 'lib/lp/services/mail/tests/test_stub.py'
--- lib/lp/services/mail/tests/test_stub.py	2011-12-28 17:03:06 +0000
+++ lib/lp/services/mail/tests/test_stub.py	2012-07-02 20:16:24 +0000
@@ -103,8 +103,8 @@
     'X-Generated-By' not only indicates that the source is Launchpad, but
     shows the bzr revision and instance name.
 
-    >>> message['X-Generated-By']
-    'Launchpad (canonical.com); Revision="1999";\n\tInstance="launchpad-lazr.conf"'
+    >>> message['X-Generated-By'].replace('\n\t', '\n ')
+    'Launchpad (canonical.com); Revision="1999";\n Instance="launchpad-lazr.conf"'
 
     """
 

=== modified file 'lib/lp/soyuz/tests/test_packageupload.py'
--- lib/lp/soyuz/tests/test_packageupload.py	2012-06-07 16:43:28 +0000
+++ lib/lp/soyuz/tests/test_packageupload.py	2012-07-02 20:16:24 +0000
@@ -261,11 +261,9 @@
         self.assertEquals(
             str(to_addrs), "['breezy-autotest-changes@xxxxxxxxxxxxxxxx']")
 
-        expected_subject = (
-            '[ubuntutest/breezy-autotest-security]\n\t'
-            'dist-upgrader_20060302.0120_all.tar.gz, '
-            'foocomm 1.0-2 (Accepted)')
-        self.assertEquals(msg['Subject'], expected_subject)
+        self.assertEquals('[ubuntutest/breezy-autotest-security]\n '
+            'dist-upgrader_20060302.0120_all.tar.gz, foocomm 1.0-2 (Accepted)',
+            msg['Subject'].replace('\n\t', '\n '))
 
         self.assertEquals(body,
             'foocomm (1.0-2) breezy; urgency=low\n\n'


Follow ups