Re: [PATCH] test: json show format of message with inline attachment with filename
authorPieter Praet <pieter@praet.org>
Fri, 11 Nov 2011 00:18:56 +0000 (01:18 +0100)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:40:03 +0000 (09:40 -0800)
b3/f3f0106c83db1dcb9089aeffedb29a12122550 [new file with mode: 0644]

diff --git a/b3/f3f0106c83db1dcb9089aeffedb29a12122550 b/b3/f3f0106c83db1dcb9089aeffedb29a12122550
new file mode 100644 (file)
index 0000000..f8ed2c2
--- /dev/null
@@ -0,0 +1,133 @@
+Return-Path: <pieter@praet.org>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id 1D7F7429E25\r
+       for <notmuch@notmuchmail.org>; Thu, 10 Nov 2011 16:19:52 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.7\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5\r
+       tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id 0CH-ig8EDvnb for <notmuch@notmuchmail.org>;\r
+       Thu, 10 Nov 2011 16:19:51 -0800 (PST)\r
+Received: from mail-ww0-f41.google.com (mail-ww0-f41.google.com\r
+ [74.125.82.41])       (using TLSv1 with cipher RC4-SHA (128/128 bits))        (No client\r
+ certificate requested)        by olra.theworths.org (Postfix) with ESMTPS id\r
+ 53596431FB6   for <notmuch@notmuchmail.org>; Thu, 10 Nov 2011 16:19:51 -0800\r
+ (PST)\r
+Received: by wwf25 with SMTP id 25so1308338wwf.2\r
+       for <notmuch@notmuchmail.org>; Thu, 10 Nov 2011 16:19:45 -0800 (PST)\r
+Received: by 10.227.199.197 with SMTP id et5mr5461208wbb.2.1320970785030;\r
+       Thu, 10 Nov 2011 16:19:45 -0800 (PST)\r
+Received: from localhost (26.48-242-81.adsl-dyn.isp.belgacom.be.\r
+       [81.242.48.26])\r
+       by mx.google.com with ESMTPS id e7sm11462857wbh.12.2011.11.10.16.19.43\r
+       (version=TLSv1/SSLv3 cipher=OTHER);\r
+       Thu, 10 Nov 2011 16:19:44 -0800 (PST)\r
+From: Pieter Praet <pieter@praet.org>\r
+To: Dmitry Kurochkin <dmitry.kurochkin@gmail.com>, notmuch@notmuchmail.org\r
+Subject: Re: [PATCH] test: json show format of message with inline attachment\r
+       with filename\r
+In-Reply-To: <1309485830-32666-1-git-send-email-dmitry.kurochkin@gmail.com>\r
+References: <1309485830-32666-1-git-send-email-dmitry.kurochkin@gmail.com>\r
+User-Agent: Notmuch/0.9+37~g8861220 (http://notmuchmail.org) Emacs/23.3.1\r
+       (x86_64-unknown-linux-gnu)\r
+Date: Fri, 11 Nov 2011 01:18:56 +0100\r
+Message-ID: <87ehxftssv.fsf@praet.org>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain; charset=utf-8\r
+Content-Transfer-Encoding: quoted-printable\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+       <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Fri, 11 Nov 2011 00:19:52 -0000\r
+\r
+On Fri,  1 Jul 2011 06:03:50 +0400, Dmitry Kurochkin <dmitry.kurochkin@gmai=\r
+l.com> wrote:\r
+> The patch adds a test to check that json show format includes\r
+> filenames for attachments with inline disposition.\r
+> ---\r
+>=20\r
+> Carl, I owe you this test case for my patch that added filenames\r
+> for inline attachments :)\r
+>=20\r
+> Regards,\r
+>   Dmitry\r
+>=20\r
+>  test/json |   13 +++++++++++++\r
+>  1 files changed, 13 insertions(+), 0 deletions(-)\r
+>=20\r
+> diff --git a/test/json b/test/json\r
+> index 5a2544c..592b068 100755\r
+> --- a/test/json\r
+> +++ b/test/json\r
+> @@ -23,6 +23,19 @@ add_message "[subject]=3D\"json-show-utf8-body-s=C3=BC=\r
+bj=C3=A9ct\"" "[date]=3D\"Sat, 01 Jan\r
+>  output=3D$(notmuch show --format=3Djson "js=C3=B6n-show-m=C3=A9ssage")\r
+>  test_expect_equal "$output" "[[[{\"id\": \"${gen_msg_id}\", \"match\": t=\r
+rue, \"filename\": \"${gen_msg_filename}\", \"timestamp\": 946728000, \"dat=\r
+e_relative\": \"2000-01-01\", \"tags\": [\"inbox\",\"unread\"], \"headers\"=\r
+: {\"Subject\": \"json-show-utf8-body-s=C3=BCbj=C3=A9ct\", \"From\": \"Notm=\r
+uch Test Suite <test_suite@notmuchmail.org>\", \"To\": \"Notmuch Test Suite=\r
+ <test_suite@notmuchmail.org>\", \"Cc\": \"\", \"Bcc\": \"\", \"Date\": \"S=\r
+at, 01 Jan 2000 12:00:00 -0000\"}, \"body\": [{\"id\": 1, \"content-type\":=\r
+ \"text/plain\", \"content\": \"js=C3=B6n-show-m=C3=A9ssage\n\"}]}, []]]]"\r
+>=20=20\r
+> +test_begin_subtest "Show message: json, inline attachment filename"\r
+> +subject=3D'json-show-inline-attachment-filename'\r
+> +id=3D"json-show-inline-attachment-filename@notmuchmail.org"\r
+> +emacs_deliver_message \\r
+> +    "$subject" \\r
+> +    'This is a test message with inline attachment with a filename' \\r
+> +    "(mml-attach-file \"$TEST_DIRECTORY/README\" nil nil \"inline\")\r
+> +     (message-goto-eoh)\r
+> +     (insert \"Message-ID: <$id>\n\")"\r
+> +output=3D$(notmuch show --format=3Djson "id:$id")\r
+> +filename=3D$(notmuch search --output=3Dfiles "id:$id")\r
+> +test_expect_equal "$output" "[[[{\"id\": \"$id\", \"match\": true, \"fil=\r
+ename\": \"$filename\", \"timestamp\": 946728000, \"date_relative\": \"2000=\r
+-01-01\", \"tags\": [\"inbox\"], \"headers\": {\"Subject\": \"$subject\", \=\r
+"From\": \"Notmuch Test Suite <test_suite@notmuchmail.org>\", \"To\": \"tes=\r
+t_suite@notmuchmail.org\", \"Cc\": \"\", \"Bcc\": \"\", \"Date\": \"01 Jan =\r
+2000 12:00:00 -0000\"}, \"body\": [{\"id\": 1, \"content-type\": \"multipar=\r
+t/mixed\", \"content\": [{\"id\": 2, \"content-type\": \"text/plain\", \"co=\r
+ntent\": \"This is a test message with inline attachment with a filename\"}=\r
+, {\"id\": 3, \"content-type\": \"application/octet-stream\", \"filename\":=\r
+ \"README\"}]}]}, []]]]"\r
+> +\r
+>  test_begin_subtest "Search message: json, utf-8"\r
+>  add_message "[subject]=3D\"json-search-utf8-body-s=C3=BCbj=C3=A9ct\"" "[=\r
+date]=3D\"Sat, 01 Jan 2000 12:00:00 -0000\"" "[body]=3D\"js=C3=B6n-search-m=\r
+=C3=A9ssage\""\r
+>  output=3D$(notmuch search --format=3Djson "js=C3=B6n-search-m=C3=A9ssage=\r
+" | notmuch_search_sanitize)\r
+> --=20\r
+> 1.7.5.4\r
+>=20\r
+> _______________________________________________\r
+> notmuch mailing list\r
+> notmuch@notmuchmail.org\r
+> http://notmuchmail.org/mailman/listinfo/notmuch\r
+\r
+Appears to have been merged in by the powers that be: commit 749abb74\r
+\r
+Thanks!\r
+\r
+\r
+Peace\r
+\r
+--=20\r
+Pieter\r