1 Return-Path: <dmitry.kurochkin@gmail.com>
\r
2 X-Original-To: notmuch@notmuchmail.org
\r
3 Delivered-To: notmuch@notmuchmail.org
\r
4 Received: from localhost (localhost [127.0.0.1])
\r
5 by olra.theworths.org (Postfix) with ESMTP id 6D7AE421192
\r
6 for <notmuch@notmuchmail.org>; Thu, 30 Jun 2011 19:04:02 -0700 (PDT)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
11 X-Spam-Status: No, score=-0.799 tagged_above=-999 required=5
\r
12 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,
\r
13 FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled
\r
14 Received: from olra.theworths.org ([127.0.0.1])
\r
15 by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)
\r
16 with ESMTP id srjiaPhhEBzD for <notmuch@notmuchmail.org>;
\r
17 Thu, 30 Jun 2011 19:04:01 -0700 (PDT)
\r
18 Received: from mail-bw0-f53.google.com (mail-bw0-f53.google.com
\r
19 [209.85.214.53]) (using TLSv1 with cipher RC4-SHA (128/128 bits))
\r
20 (No client certificate requested)
\r
21 by olra.theworths.org (Postfix) with ESMTPS id 4632E42118E
\r
22 for <notmuch@notmuchmail.org>; Thu, 30 Jun 2011 19:04:01 -0700 (PDT)
\r
23 Received: by bwg12 with SMTP id 12so2604116bwg.26
\r
24 for <notmuch@notmuchmail.org>; Thu, 30 Jun 2011 19:04:00 -0700 (PDT)
\r
25 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
\r
26 h=from:to:cc:subject:date:message-id:x-mailer:mime-version
\r
27 :content-type:content-transfer-encoding;
\r
28 bh=gNZk6uX3WuYJOmm0MQhO/nvgA29UfVepK2+AklEL4KQ=;
\r
29 b=JynM3W/oEXSw5lTnX3156MCekGsK32PXWUYjaj3FarzZVaCqjKqQINAeN+Oi3Q8PWF
\r
30 jnVZq79rWLXTnfG7hbauGJbsbPVA5Xq1NYrwVGADMk6n+bbTZCYQkOtjewFj9PqXI25S
\r
31 7YASfGr4sOzyUl+oIPYOEfU1I1cDba6AKqKiw=
\r
32 Received: by 10.204.101.10 with SMTP id a10mr2660771bko.183.1309485839837;
\r
33 Thu, 30 Jun 2011 19:03:59 -0700 (PDT)
\r
34 Received: from localhost ([91.144.186.21])
\r
35 by mx.google.com with ESMTPS id ek1sm2556719bkb.21.2011.06.30.19.03.57
\r
36 (version=TLSv1/SSLv3 cipher=OTHER);
\r
37 Thu, 30 Jun 2011 19:03:58 -0700 (PDT)
\r
38 From: Dmitry Kurochkin <dmitry.kurochkin@gmail.com>
\r
39 To: notmuch@notmuchmail.org
\r
40 Subject: [PATCH] test: json show format of message with inline attachment with filename
\r
41 Date: Fri, 1 Jul 2011 06:03:50 +0400
\r
42 Message-Id: <1309485830-32666-1-git-send-email-dmitry.kurochkin@gmail.com>
\r
43 X-Mailer: git-send-email 1.7.5.4
\r
45 Content-Type: text/plain; charset=UTF-8
\r
46 Content-Transfer-Encoding: 8bit
\r
47 X-BeenThere: notmuch@notmuchmail.org
\r
48 X-Mailman-Version: 2.1.13
\r
50 List-Id: "Use and development of the notmuch mail system."
\r
51 <notmuch.notmuchmail.org>
\r
52 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
53 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
54 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
55 List-Post: <mailto:notmuch@notmuchmail.org>
\r
56 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
57 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
58 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
59 X-List-Received-Date: Fri, 01 Jul 2011 02:04:02 -0000
\r
61 The patch adds a test to check that json show format includes
\r
62 filenames for attachments with inline disposition.
\r
65 Carl, I owe you this test case for my patch that added filenames
\r
66 for inline attachments :)
\r
71 test/json | 13 +++++++++++++
\r
72 1 files changed, 13 insertions(+), 0 deletions(-)
\r
74 diff --git a/test/json b/test/json
\r
75 index 5a2544c..592b068 100755
\r
78 @@ -23,6 +23,19 @@ add_message "[subject]=\"json-show-utf8-body-sübjéct\"" "[date]=\"Sat, 01 Jan
\r
79 output=$(notmuch show --format=json "jsön-show-méssage")
\r
80 test_expect_equal "$output" "[[[{\"id\": \"${gen_msg_id}\", \"match\": true, \"filename\": \"${gen_msg_filename}\", \"timestamp\": 946728000, \"date_relative\": \"2000-01-01\", \"tags\": [\"inbox\",\"unread\"], \"headers\": {\"Subject\": \"json-show-utf8-body-sübjéct\", \"From\": \"Notmuch Test Suite <test_suite@notmuchmail.org>\", \"To\": \"Notmuch Test Suite <test_suite@notmuchmail.org>\", \"Cc\": \"\", \"Bcc\": \"\", \"Date\": \"Sat, 01 Jan 2000 12:00:00 -0000\"}, \"body\": [{\"id\": 1, \"content-type\": \"text/plain\", \"content\": \"jsön-show-méssage\n\"}]}, []]]]"
\r
82 +test_begin_subtest "Show message: json, inline attachment filename"
\r
83 +subject='json-show-inline-attachment-filename'
\r
84 +id="json-show-inline-attachment-filename@notmuchmail.org"
\r
85 +emacs_deliver_message \
\r
87 + 'This is a test message with inline attachment with a filename' \
\r
88 + "(mml-attach-file \"$TEST_DIRECTORY/README\" nil nil \"inline\")
\r
89 + (message-goto-eoh)
\r
90 + (insert \"Message-ID: <$id>\n\")"
\r
91 +output=$(notmuch show --format=json "id:$id")
\r
92 +filename=$(notmuch search --output=files "id:$id")
\r
93 +test_expect_equal "$output" "[[[{\"id\": \"$id\", \"match\": true, \"filename\": \"$filename\", \"timestamp\": 946728000, \"date_relative\": \"2000-01-01\", \"tags\": [\"inbox\"], \"headers\": {\"Subject\": \"$subject\", \"From\": \"Notmuch Test Suite <test_suite@notmuchmail.org>\", \"To\": \"test_suite@notmuchmail.org\", \"Cc\": \"\", \"Bcc\": \"\", \"Date\": \"01 Jan 2000 12:00:00 -0000\"}, \"body\": [{\"id\": 1, \"content-type\": \"multipart/mixed\", \"content\": [{\"id\": 2, \"content-type\": \"text/plain\", \"content\": \"This is a test message with inline attachment with a filename\"}, {\"id\": 3, \"content-type\": \"application/octet-stream\", \"filename\": \"README\"}]}]}, []]]]"
\r
95 test_begin_subtest "Search message: json, utf-8"
\r
96 add_message "[subject]=\"json-search-utf8-body-sübjéct\"" "[date]=\"Sat, 01 Jan 2000 12:00:00 -0000\"" "[body]=\"jsön-search-méssage\""
\r
97 output=$(notmuch search --format=json "jsön-search-méssage" | notmuch_search_sanitize)
\r