← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~mars/launchpad/fix-ec2test-utf-in-devel into lp:launchpad/devel

 

Māris Fogels has proposed merging lp:~mars/launchpad/fix-ec2test-utf-in-devel into lp:launchpad/devel.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)


Hi,

This branch fixes a problem on production-devel and Maverick local developer stations where a test would fail with a UTF-8 decoding error.  This patch has already landed in production (see https://code.edge.launchpad.net/~mars/launchpad/fix-ec2test-on-production-devel/+merge/37526).

Maris
-- 
https://code.launchpad.net/~mars/launchpad/fix-ec2test-utf-in-devel/+merge/37760
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~mars/launchpad/fix-ec2test-utf-in-devel into lp:launchpad/devel.
=== modified file 'lib/devscripts/ec2test/tests/test_remote.py'
--- lib/devscripts/ec2test/tests/test_remote.py	2010-09-20 22:44:49 +0000
+++ lib/devscripts/ec2test/tests/test_remote.py	2010-10-06 16:47:46 +0000
@@ -986,10 +986,14 @@
         result = self.make_failing_result()
         logger.got_result(result)
         [user_message] = log
+        error_result_string = request.format_result(
+                result, logger._start_time, logger._end_time)
+        # Stringify the utf8-encoded MIME text message part containing the
+        # test run summary.
+        summary_text = user_message.get_payload(0).get_payload(decode=True)
         self.assertEqual(
-            request.format_result(
-                result, logger._start_time, logger._end_time),
-            self.get_body_text(user_message).decode('quoted-printable'))
+            error_result_string,
+            summary_text)
 
     def test_gzip_of_full_log_attached(self):
         # The full log is attached to the email.