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 6D7AE421192 for ; Thu, 30 Jun 2011 19:04:02 -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 srjiaPhhEBzD for ; Thu, 30 Jun 2011 19:04:01 -0700 (PDT) Received: from mail-bw0-f53.google.com (mail-bw0-f53.google.com [209.85.214.53]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id 4632E42118E for ; Thu, 30 Jun 2011 19:04:01 -0700 (PDT) Received: by bwg12 with SMTP id 12so2604116bwg.26 for ; Thu, 30 Jun 2011 19:04:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer:mime-version :content-type:content-transfer-encoding; bh=gNZk6uX3WuYJOmm0MQhO/nvgA29UfVepK2+AklEL4KQ=; b=JynM3W/oEXSw5lTnX3156MCekGsK32PXWUYjaj3FarzZVaCqjKqQINAeN+Oi3Q8PWF jnVZq79rWLXTnfG7hbauGJbsbPVA5Xq1NYrwVGADMk6n+bbTZCYQkOtjewFj9PqXI25S 7YASfGr4sOzyUl+oIPYOEfU1I1cDba6AKqKiw= Received: by 10.204.101.10 with SMTP id a10mr2660771bko.183.1309485839837; Thu, 30 Jun 2011 19:03:59 -0700 (PDT) Received: from localhost ([91.144.186.21]) by mx.google.com with ESMTPS id ek1sm2556719bkb.21.2011.06.30.19.03.57 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 30 Jun 2011 19:03:58 -0700 (PDT) From: Dmitry Kurochkin To: notmuch@notmuchmail.org Subject: [PATCH] test: json show format of message with inline attachment with filename Date: Fri, 1 Jul 2011 06:03:50 +0400 Message-Id: <1309485830-32666-1-git-send-email-dmitry.kurochkin@gmail.com> X-Mailer: git-send-email 1.7.5.4 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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: Fri, 01 Jul 2011 02:04:02 -0000 The patch adds a test to check that json show format includes filenames for attachments with inline disposition. --- Carl, I owe you this test case for my patch that added filenames for inline attachments :) Regards, Dmitry test/json | 13 +++++++++++++ 1 files changed, 13 insertions(+), 0 deletions(-) diff --git a/test/json b/test/json index 5a2544c..592b068 100755 --- a/test/json +++ b/test/json @@ -23,6 +23,19 @@ add_message "[subject]=\"json-show-utf8-body-sübjéct\"" "[date]=\"Sat, 01 Jan output=$(notmuch show --format=json "jsön-show-méssage") 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 \", \"To\": \"Notmuch Test Suite \", \"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\"}]}, []]]]" +test_begin_subtest "Show message: json, inline attachment filename" +subject='json-show-inline-attachment-filename' +id="json-show-inline-attachment-filename@notmuchmail.org" +emacs_deliver_message \ + "$subject" \ + 'This is a test message with inline attachment with a filename' \ + "(mml-attach-file \"$TEST_DIRECTORY/README\" nil nil \"inline\") + (message-goto-eoh) + (insert \"Message-ID: <$id>\n\")" +output=$(notmuch show --format=json "id:$id") +filename=$(notmuch search --output=files "id:$id") +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 \", \"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\"}]}]}, []]]]" + test_begin_subtest "Search message: json, utf-8" 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\"" output=$(notmuch search --format=json "jsön-search-méssage" | notmuch_search_sanitize) -- 1.7.5.4