From e2e397fad27d1a9bfc292529bce2afd7956e79d8 Mon Sep 17 00:00:00 2001 From: Dmitry Kurochkin Date: Wed, 3 Oct 2012 18:41:07 +0400 Subject: [PATCH] Re: [PATCH 2/3] test: Add a test for HTML email with inline images --- a8/60d35604c74aa7f4ad0d7cdf0c8eec9e51cb83 | 150 ++++++++++++++++++++++ 1 file changed, 150 insertions(+) create mode 100644 a8/60d35604c74aa7f4ad0d7cdf0c8eec9e51cb83 diff --git a/a8/60d35604c74aa7f4ad0d7cdf0c8eec9e51cb83 b/a8/60d35604c74aa7f4ad0d7cdf0c8eec9e51cb83 new file mode 100644 index 000000000..5b83056b5 --- /dev/null +++ b/a8/60d35604c74aa7f4ad0d7cdf0c8eec9e51cb83 @@ -0,0 +1,150 @@ +Return-Path: +X-Original-To: notmuch@notmuchmail.org +Delivered-To: notmuch@notmuchmail.org +Received: from localhost (localhost [127.0.0.1]) + by olra.theworths.org (Postfix) with ESMTP id A2BEA431FB6 + for ; Wed, 3 Oct 2012 07:41:13 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: -0.799 +X-Spam-Level: +X-Spam-Status: No, score=-0.799 tagged_above=-999 required=5 + tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, + FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled +Received: from olra.theworths.org ([127.0.0.1]) + by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id 8w5ucht2Dp4G for ; + Wed, 3 Oct 2012 07:41:13 -0700 (PDT) +Received: from mail-lb0-f181.google.com (mail-lb0-f181.google.com + [209.85.217.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id B21AB431FAE + for ; Wed, 3 Oct 2012 07:41:12 -0700 (PDT) +Received: by lbbgg6 with SMTP id gg6so6442350lbb.26 + for ; Wed, 03 Oct 2012 07:41:09 -0700 (PDT) +DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; + h=from:to:cc:subject:in-reply-to:references:user-agent:date + :message-id:mime-version:content-type; + bh=SNRgZAG19pGg8BdWyQXLe3ZnivGbSsGx7ILkCot0/Q4=; + b=Ku+ZsXIyj8wiafXRmd/DtQtmQfav/vQWwPOCjMqZnXz58gQ7FDona3KkdFWHNVomM6 + MyPpt9OFK6z32MqAPQa+sWTEd3reJniLzNV0FnLfwk32esyK8ZvA+mJSdo+SzpVkc60m + cAeV17CrYSFnASGtZA60D1ZaMGeAZC4cgRm6Ah+XrA/SVJdbmdsOrxIIkpvmo2RBHwIh + RfREmZFCYesD3RXmFp0fiHrrOeKDSdT/Fk/ajL2zdHbSA5DnY5C0KwiHE0vv01fZf2Z+ + oJMsXFMFwztROu6gaQOpJCTBRJW7GDyqClYhaCRcAvpV3zRbqn8g6xWXXzwrakRefq3i + nzLg== +Received: by 10.112.38.39 with SMTP id d7mr1785649lbk.112.1349275269802; + Wed, 03 Oct 2012 07:41:09 -0700 (PDT) +Received: from localhost ([91.144.186.21]) + by mx.google.com with ESMTPS id oj5sm1411951lab.8.2012.10.03.07.41.08 + (version=TLSv1/SSLv3 cipher=OTHER); + Wed, 03 Oct 2012 07:41:08 -0700 (PDT) +From: Dmitry Kurochkin +To: Austin Clements +Subject: Re: [PATCH 2/3] test: Add a test for HTML email with inline images +In-Reply-To: <20121003142834.GC14861@mit.edu> +References: <1348941314-8377-1-git-send-email-amdragon@mit.edu> + <1348941314-8377-3-git-send-email-amdragon@mit.edu> + <87a9w3vqye.fsf@gmail.com> <20121003142834.GC14861@mit.edu> +User-Agent: Notmuch/0.14+38~g322117b (http://notmuchmail.org) Emacs/23.4.1 + (x86_64-pc-linux-gnu) +Date: Wed, 03 Oct 2012 18:41:07 +0400 +Message-ID: <87iparwrcs.fsf@gmail.com> +MIME-Version: 1.0 +Content-Type: text/plain; charset=us-ascii +Cc: notmuch@notmuchmail.org +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.13 +Precedence: list +List-Id: "Use and development of the notmuch mail system." + +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +X-List-Received-Date: Wed, 03 Oct 2012 14:41:13 -0000 + +Austin Clements writes: + +> Quoth Dmitry Kurochkin on Oct 03 at 1:35 pm: +>> Hi Austin. +>> +>> Austin Clements writes: +>> +>> > Currently this test passes in Emacs 23 but fails in Emacs 24 (at least +>> > on some Linux distributions). +>> +>> The test fails for me on Emacs 23.4.1 (Debian unstable): +>> +>> FAIL Rendering HTML mail with images +>> --- emacs.51.OUTPUT 2012-10-03 09:31:33.383529764 +0000 +>> +++ emacs.51.EXPECTED 2012-10-03 09:31:33.383529764 +0000 +>> @@ -6,4 +6,3 @@ +>> [ multipart/related ] +>> [ text/html ] +>> * +>> - +>> +>> Did not look into details. +> +> Yes. This test is (in hindsight, unsurprisingly) sensitive to +> whatever HTML renderer Emacs chooses. It looks like you're probably +> using html2text, which outputs nothing for an image. Unfortunately, +> none of the built-in renderers in Emacs 23 are aware of content +> references, which makes this test rather pointless on Emacs 23 unless +> we depend on an external renderer. +> +> The best solution I can think of dynamically chooses shr on Emacs 24 +> (since that's really what we're trying to test) and gives up on Emacs +> 23 and forcibly selects html2text (test patch below). Alternatively, +> we could cycle through all of the available renderers, test everything +> that we can, and just ignore everything that we can't run, though that +> would make the test environment-sensitive. +> + +Perhaps the test should be skipped if shr is not available, like we do +for missing binaries? + +Regards, + Dmitry + +> diff --git a/test/emacs b/test/emacs +> index 1f84b91..2ef78bf 100755 +> --- a/test/emacs +> +++ b/test/emacs +> @@ -756,7 +756,7 @@ add_message '[subject]="HTML mail with images"' \ +> '[body]="--abcd +> Content-Type: text/html +> +> - +> + smiley +> +> --abcd +> Content-Type: image/gif +> @@ -766,10 +766,13 @@ Content-ID: <330@goomoji.gmail> +> R0lGODlhDAAMAKIFAF5LAP/zxAAAANyuAP/gaP///wAAAAAAACH5BAEAAAUALAAAAAAMAAwAAAMl +> WLPcGjDKFYi9lxKBOaGcF35DhWHamZUW0K4mAbiwWtuf0uxFAgA7 +> --abcd--"' +> -test_emacs "(notmuch-show \"id:${gen_msg_id}\") +> +test_emacs "(let ((mm-text-html-renderer +> + (if (assq 'shr mm-text-html-renderer-alist) +> + 'shr 'html2text))) +> + (notmuch-show \"id:${gen_msg_id}\")) +> (test-output)" +> # Normalize output for Emacs 23 and Emacs 24 +> -sed -i 's/\[cid\]/*/' OUTPUT +> +sed -i 's/^ smiley/* smiley/' OUTPUT +> cat <EXPECTED +> Notmuch Test Suite (2001-01-05) (inbox) +> Subject: HTML mail with images +> @@ -778,7 +781,7 @@ Date: Fri, 05 Jan 2001 15:43:57 +0000 +> +> [ multipart/related ] +> [ text/html ] +> -* +> +* smiley +> EOF +> test_expect_equal_file OUTPUT EXPECTED +> -- 2.26.2