Re: [PATCH v4 13/16] add indexopts to notmuch python bindings.
[notmuch-archives.git] / c0 / ae1b2e7e818dce872bc6ddfe63ad0843831fcc
1 Return-Path: <amdragon@mit.edu>\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 D38FE431FAF\r
6         for <notmuch@notmuchmail.org>; Tue, 24 Jul 2012 19:35:20 -0700 (PDT)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: -0.7\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5\r
12         tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
13 Received: from olra.theworths.org ([127.0.0.1])\r
14         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
15         with ESMTP id PEKHoKkuQOri for <notmuch@notmuchmail.org>;\r
16         Tue, 24 Jul 2012 19:35:18 -0700 (PDT)\r
17 Received: from dmz-mailsec-scanner-8.mit.edu (DMZ-MAILSEC-SCANNER-8.MIT.EDU\r
18         [18.7.68.37])\r
19         by olra.theworths.org (Postfix) with ESMTP id 5997C431FC4\r
20         for <notmuch@notmuchmail.org>; Tue, 24 Jul 2012 19:35:07 -0700 (PDT)\r
21 X-AuditID: 12074425-b7f9b6d0000008c4-17-500f5b593dc4\r
22 Received: from mailhub-auth-4.mit.edu ( [18.7.62.39])\r
23         by dmz-mailsec-scanner-8.mit.edu (Symantec Messaging Gateway) with SMTP\r
24         id 52.8F.02244.95B5F005; Tue, 24 Jul 2012 22:35:05 -0400 (EDT)\r
25 Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103])\r
26         by mailhub-auth-4.mit.edu (8.13.8/8.9.2) with ESMTP id q6P2Z5nu008582; \r
27         Tue, 24 Jul 2012 22:35:05 -0400\r
28 Received: from drake.dyndns.org\r
29         (209-6-116-242.c3-0.arl-ubr1.sbo-arl.ma.cable.rcn.com\r
30         [209.6.116.242]) (authenticated bits=0)\r
31         (User authenticated as amdragon@ATHENA.MIT.EDU)\r
32         by outgoing.mit.edu (8.13.6/8.12.4) with ESMTP id q6P2Z2fL025118\r
33         (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT);\r
34         Tue, 24 Jul 2012 22:35:04 -0400 (EDT)\r
35 Received: from amthrax by drake.dyndns.org with local (Exim 4.77)\r
36         (envelope-from <amdragon@mit.edu>)\r
37         id 1StrRF-0004Yl-MW; Tue, 24 Jul 2012 22:35:01 -0400\r
38 From: Austin Clements <amdragon@MIT.EDU>\r
39 To: notmuch@notmuchmail.org\r
40 Subject: [PATCH 02/13] test: Remove unnecessary JSON canonicalization\r
41 Date: Tue, 24 Jul 2012 22:34:42 -0400\r
42 Message-Id: <1343183693-17134-3-git-send-email-amdragon@mit.edu>\r
43 X-Mailer: git-send-email 1.7.10\r
44 In-Reply-To: <1343183693-17134-1-git-send-email-amdragon@mit.edu>\r
45 References: <1343183693-17134-1-git-send-email-amdragon@mit.edu>\r
46 MIME-Version: 1.0\r
47 Content-Type: text/plain; charset=UTF-8\r
48 Content-Transfer-Encoding: 8bit\r
49 X-Brightmail-Tracker:\r
50  H4sIAAAAAAAAA+NgFmphleLIzCtJLcpLzFFi42IRYrdT142M5g8w2PbL2GJvQzujxfWbM5kd\r
51         mDwWb9rP5vFs1S3mAKYoLpuU1JzMstQifbsErowzx76yFHx1qdjxZjJzA+Nr6y5GTg4JAROJ\r
52         Nx83s0HYYhIX7q0Hsrk4hAT2MUp8ej+NHcLZwCjxtes4I4TziEni++ZvUM5cRonDLRNYQPrZ\r
53         BDQktu1fzghiiwhIS+y8O5sVxGYWMJOY+3Mi2A5hgWSJey1rmUBsFgFViSWdB8BsXgEHicWr\r
54         FjNC3CEv8fR+H1g9p4CjxPklC8HiQkA1PYuvsUPUC0qcnPkEaC8H0Hx1ifXzhCBWyUs0b53N\r
55         PIFRaBaSqlkIVbOQVC1gZF7FKJuSW6Wbm5iZU5yarFucnJiXl1qka6GXm1mil5pSuokRHNgu\r
56         qjsYJxxSOsQowMGoxMP76wlfgBBrYllxZe4hRkkOJiVR3opg/gAhvqT8lMqMxOKM+KLSnNTi\r
57         Q4wSHMxKIrxFYUA53pTEyqrUonyYlDQHi5I4742Um/5CAumJJanZqakFqUUwWRkODiUJ3tYo\r
58         oEbBotT01Iq0zJwShDQTByfIcB6g4awgNbzFBYm5xZnpEPlTjIpS4rzaIAkBkERGaR5cLyzx\r
59         vGIUB3pFmLcZpIoHmLTgul8BDWYCGvw8jA9kcEkiQkqqgdFn5pMu1d/vd4YcWPoqxorBQNj7\r
60         RXH5z1MOv+3Ofq4PqpZ5eWzrI1kplRS2aSrJq6pz3Tksmqcy6HzfseE3Sx2vgpjLv77tQt4r\r
61         BMsU2d+vXOOQ66plJaltECQcdc7F8IjWtrvLF2sqX1qrpV2UYPHtWR7Hmbfc+7e8mac7dZNR\r
62         V/3T+jkr7iqxFGckGmoxFxUnAgA+N6KFFwMAAA==\r
63 X-BeenThere: notmuch@notmuchmail.org\r
64 X-Mailman-Version: 2.1.13\r
65 Precedence: list\r
66 List-Id: "Use and development of the notmuch mail system."\r
67         <notmuch.notmuchmail.org>\r
68 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
69         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
70 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
71 List-Post: <mailto:notmuch@notmuchmail.org>\r
72 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
73 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
74         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
75 X-List-Received-Date: Wed, 25 Jul 2012 02:35:21 -0000\r
76 \r
77 Format canonicalization of JSON output is no longer necessary, so\r
78 remove it.  Value canonicalization (e.g., normalizing thread IDs) is\r
79 still necessary, so all of the sanitization functions remain.\r
80 ---\r
81  test/json         |    4 ++--\r
82  test/maildir-sync |    1 -\r
83  test/multipart    |   40 ++++++++++------------------------------\r
84  3 files changed, 12 insertions(+), 33 deletions(-)\r
85 \r
86 diff --git a/test/json b/test/json\r
87 index d86ee46..ac8fa8e 100755\r
88 --- a/test/json\r
89 +++ b/test/json\r
90 @@ -18,7 +18,7 @@ test_expect_equal_json "$output" "[[[{\"id\": \"${gen_msg_id}\", \"match\": true\r
91  \r
92  test_begin_subtest "Search message: json"\r
93  add_message "[subject]=\"json-search-subject\"" "[date]=\"Sat, 01 Jan 2000 12:00:00 -0000\"" "[body]=\"json-search-message\""\r
94 -output=$(notmuch search --format=json "json-search-message" | notmuch_json_show_sanitize | notmuch_search_sanitize)\r
95 +output=$(notmuch search --format=json "json-search-message" | notmuch_search_sanitize)\r
96  test_expect_equal_json "$output" "[{\"thread\": \"XXX\",\r
97   \"timestamp\": 946728000,\r
98   \"date_relative\": \"2000-01-01\",\r
99 @@ -49,7 +49,7 @@ test_expect_equal_json "$output" "[[[{\"id\": \"$id\", \"match\": true, \"exclud\r
100  \r
101  test_begin_subtest "Search message: json, utf-8"\r
102  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
103 -output=$(notmuch search --format=json "jsön-search-méssage" | notmuch_json_show_sanitize | notmuch_search_sanitize)\r
104 +output=$(notmuch search --format=json "jsön-search-méssage" | notmuch_search_sanitize)\r
105  test_expect_equal_json "$output" "[{\"thread\": \"XXX\",\r
106   \"timestamp\": 946728000,\r
107   \"date_relative\": \"2000-01-01\",\r
108 diff --git a/test/maildir-sync b/test/maildir-sync\r
109 index b748d04..cd7d241 100755\r
110 --- a/test/maildir-sync\r
111 +++ b/test/maildir-sync\r
112 @@ -7,7 +7,6 @@ test_description="maildir synchronization"\r
113  # Avoid including the local value of MAIL_DIR in the result.\r
114  filter_show_json() {\r
115      sed -e "s|${MAIL_DIR}/|MAIL_DIR/|"\r
116 -    echo\r
117  }\r
118  \r
119  # Create the expected maildir structure\r
120 diff --git a/test/multipart b/test/multipart\r
121 index 3ccf27f..0527f84 100755\r
122 --- a/test/multipart\r
123 +++ b/test/multipart\r
124 @@ -319,10 +319,8 @@ test_expect_success \\r
125      "notmuch show --format=text --part=8 'id:87liy5ap00.fsf@yoom.home.cworth.org'"\r
126  \r
127  test_begin_subtest "--format=json --part=0, full message"\r
128 -notmuch show --format=json --part=0 'id:87liy5ap00.fsf@yoom.home.cworth.org' | sed 's|{"id":|\n{"id":|g' >OUTPUT\r
129 -echo >>OUTPUT # expect *no* newline at end of output\r
130 +notmuch show --format=json --part=0 'id:87liy5ap00.fsf@yoom.home.cworth.org' >OUTPUT\r
131  cat <<EOF >EXPECTED\r
132 -\r
133  {"id": "87liy5ap00.fsf@yoom.home.cworth.org", "match": true, "excluded": false, "filename": "${MAIL_DIR}/multipart", "timestamp": 978709437, "date_relative": "2001-01-05", "tags": ["attachment","inbox","signed","unread"], "headers": {"Subject": "Multipart message", "From": "Carl Worth <cworth@cworth.org>", "To": "cworth@cworth.org", "Date": "Fri, 05 Jan 2001 15:43:57 +0000"}, "body": [\r
134  {"id": 1, "content-type": "multipart/signed", "content": [\r
135  {"id": 2, "content-type": "multipart/mixed", "content": [\r
136 @@ -337,10 +335,8 @@ EOF\r
137  test_expect_equal_json "$(cat OUTPUT)" "$(cat EXPECTED)"\r
138  \r
139  test_begin_subtest "--format=json --part=1, message body"\r
140 -notmuch show --format=json --part=1 'id:87liy5ap00.fsf@yoom.home.cworth.org' | sed 's|{"id":|\n{"id":|g' >OUTPUT\r
141 -echo >>OUTPUT # expect *no* newline at end of output\r
142 +notmuch show --format=json --part=1 'id:87liy5ap00.fsf@yoom.home.cworth.org' >OUTPUT\r
143  cat <<EOF >EXPECTED\r
144 -\r
145  {"id": 1, "content-type": "multipart/signed", "content": [\r
146  {"id": 2, "content-type": "multipart/mixed", "content": [\r
147  {"id": 3, "content-type": "message/rfc822", "content": [{"headers": {"Subject": "html message", "From": "Carl Worth <cworth@cworth.org>", "To": "cworth@cworth.org", "Date": "Fri, 05 Jan 2001 15:42:57 +0000"}, "body": [\r
148 @@ -354,10 +350,8 @@ EOF\r
149  test_expect_equal_json "$(cat OUTPUT)" "$(cat EXPECTED)"\r
150  \r
151  test_begin_subtest "--format=json --part=2, multipart/mixed"\r
152 -notmuch show --format=json --part=2 'id:87liy5ap00.fsf@yoom.home.cworth.org' | sed 's|{"id":|\n{"id":|g' >OUTPUT\r
153 -echo >>OUTPUT # expect *no* newline at end of output\r
154 +notmuch show --format=json --part=2 'id:87liy5ap00.fsf@yoom.home.cworth.org' >OUTPUT\r
155  cat <<EOF >EXPECTED\r
156 -\r
157  {"id": 2, "content-type": "multipart/mixed", "content": [\r
158  {"id": 3, "content-type": "message/rfc822", "content": [{"headers": {"Subject": "html message", "From": "Carl Worth <cworth@cworth.org>", "To": "cworth@cworth.org", "Date": "Fri, 05 Jan 2001 15:42:57 +0000"}, "body": [\r
159  {"id": 4, "content-type": "multipart/alternative", "content": [\r
160 @@ -369,10 +363,8 @@ EOF\r
161  test_expect_equal_json "$(cat OUTPUT)" "$(cat EXPECTED)"\r
162  \r
163  test_begin_subtest "--format=json --part=3, rfc822 part"\r
164 -notmuch show --format=json --part=3 'id:87liy5ap00.fsf@yoom.home.cworth.org' | sed 's|{"id":|\n{"id":|g' >OUTPUT\r
165 -echo >>OUTPUT # expect *no* newline at end of output\r
166 +notmuch show --format=json --part=3 'id:87liy5ap00.fsf@yoom.home.cworth.org' >OUTPUT\r
167  cat <<EOF >EXPECTED\r
168 -\r
169  {"id": 3, "content-type": "message/rfc822", "content": [{"headers": {"Subject": "html message", "From": "Carl Worth <cworth@cworth.org>", "To": "cworth@cworth.org", "Date": "Fri, 05 Jan 2001 15:42:57 +0000"}, "body": [\r
170  {"id": 4, "content-type": "multipart/alternative", "content": [\r
171  {"id": 5, "content-type": "text/html"}, \r
172 @@ -381,10 +373,8 @@ EOF\r
173  test_expect_equal_json "$(cat OUTPUT)" "$(cat EXPECTED)"\r
174  \r
175  test_begin_subtest "--format=json --part=4, rfc822's multipart/alternative"\r
176 -notmuch show --format=json --part=4 'id:87liy5ap00.fsf@yoom.home.cworth.org' | sed 's|{"id":|\n{"id":|g' >OUTPUT\r
177 -echo >>OUTPUT # expect *no* newline at end of output\r
178 +notmuch show --format=json --part=4 'id:87liy5ap00.fsf@yoom.home.cworth.org' >OUTPUT\r
179  cat <<EOF >EXPECTED\r
180 -\r
181  {"id": 4, "content-type": "multipart/alternative", "content": [\r
182  {"id": 5, "content-type": "text/html"}, \r
183  {"id": 6, "content-type": "text/plain", "content": "This is an embedded message, with a multipart/alternative part.\n"}]}\r
184 @@ -392,46 +382,36 @@ EOF\r
185  test_expect_equal_json "$(cat OUTPUT)" "$(cat EXPECTED)"\r
186  \r
187  test_begin_subtest "--format=json --part=5, rfc822's html part"\r
188 -notmuch show --format=json --part=5 'id:87liy5ap00.fsf@yoom.home.cworth.org' | sed 's|{"id":|\n{"id":|g' >OUTPUT\r
189 -echo >>OUTPUT # expect *no* newline at end of output\r
190 +notmuch show --format=json --part=5 'id:87liy5ap00.fsf@yoom.home.cworth.org' >OUTPUT\r
191  cat <<EOF >EXPECTED\r
192 -\r
193  {"id": 5, "content-type": "text/html"}\r
194  EOF\r
195  test_expect_equal_json "$(cat OUTPUT)" "$(cat EXPECTED)"\r
196  \r
197  test_begin_subtest "--format=json --part=6, rfc822's text part"\r
198 -notmuch show --format=json --part=6 'id:87liy5ap00.fsf@yoom.home.cworth.org' | sed 's|{"id":|\n{"id":|g' >OUTPUT\r
199 -echo >>OUTPUT # expect *no* newline at end of output\r
200 +notmuch show --format=json --part=6 'id:87liy5ap00.fsf@yoom.home.cworth.org' >OUTPUT\r
201  cat <<EOF >EXPECTED\r
202 -\r
203  {"id": 6, "content-type": "text/plain", "content": "This is an embedded message, with a multipart/alternative part.\n"}\r
204  EOF\r
205  test_expect_equal_json "$(cat OUTPUT)" "$(cat EXPECTED)"\r
206  \r
207  test_begin_subtest "--format=json --part=7, inline attachment"\r
208 -notmuch show --format=json --part=7 'id:87liy5ap00.fsf@yoom.home.cworth.org' | sed 's|{"id":|\n{"id":|g' >OUTPUT\r
209 -echo >>OUTPUT # expect *no* newline at end of output\r
210 +notmuch show --format=json --part=7 'id:87liy5ap00.fsf@yoom.home.cworth.org' >OUTPUT\r
211  cat <<EOF >EXPECTED\r
212 -\r
213  {"id": 7, "content-type": "text/plain", "filename": "attachment", "content": "This is a text attachment.\n"}\r
214  EOF\r
215  test_expect_equal_json "$(cat OUTPUT)" "$(cat EXPECTED)"\r
216  \r
217  test_begin_subtest "--format=json --part=8, plain text part"\r
218 -notmuch show --format=json --part=8 'id:87liy5ap00.fsf@yoom.home.cworth.org' | sed 's|{"id":|\n{"id":|g' >OUTPUT\r
219 -echo >>OUTPUT # expect *no* newline at end of output\r
220 +notmuch show --format=json --part=8 'id:87liy5ap00.fsf@yoom.home.cworth.org' >OUTPUT\r
221  cat <<EOF >EXPECTED\r
222 -\r
223  {"id": 8, "content-type": "text/plain", "content": "And this message is signed.\n\n-Carl\n"}\r
224  EOF\r
225  test_expect_equal_json "$(cat OUTPUT)" "$(cat EXPECTED)"\r
226  \r
227  test_begin_subtest "--format=json --part=9, pgp signature (unverified)"\r
228 -notmuch show --format=json --part=9 'id:87liy5ap00.fsf@yoom.home.cworth.org' | sed 's|{"id":|\n{"id":|g' >OUTPUT\r
229 -echo >>OUTPUT # expect *no* newline at end of output\r
230 +notmuch show --format=json --part=9 'id:87liy5ap00.fsf@yoom.home.cworth.org' >OUTPUT\r
231  cat <<EOF >EXPECTED\r
232 -\r
233  {"id": 9, "content-type": "application/pgp-signature"}\r
234  EOF\r
235  test_expect_equal_json "$(cat OUTPUT)" "$(cat EXPECTED)"\r
236 -- \r
237 1.7.10\r
238 \r