[PATCH] test: saving attachments from within emacs using notmuch-show-save-part
authorDmitry Kurochkin <dmitry.kurochkin@gmail.com>
Tue, 10 May 2011 01:24:49 +0000 (05:24 +0400)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:38:12 +0000 (09:38 -0800)
5a/1dd909d08caf5db51a8e64e0e2c1828fccf99c [new file with mode: 0644]

diff --git a/5a/1dd909d08caf5db51a8e64e0e2c1828fccf99c b/5a/1dd909d08caf5db51a8e64e0e2c1828fccf99c
new file mode 100644 (file)
index 0000000..c08a058
--- /dev/null
@@ -0,0 +1,107 @@
+Return-Path: <dmitry.kurochkin@gmail.com>\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 2D89F429E27\r
+       for <notmuch@notmuchmail.org>; Mon,  9 May 2011 18:24:47 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 1.7\r
+X-Spam-Level: *\r
+X-Spam-Status: No, score=1.7 tagged_above=-999 required=5\r
+       tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,\r
+       FREEMAIL_FROM=0.001, FREEMAIL_REPLY=2.499, RCVD_IN_DNSWL_LOW=-0.7]\r
+       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 fzABzXj3Geml for <notmuch@notmuchmail.org>;\r
+       Mon,  9 May 2011 18:24:46 -0700 (PDT)\r
+Received: from mail-fx0-f53.google.com (mail-fx0-f53.google.com\r
+       [209.85.161.53]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
+       (No client certificate requested)\r
+       by olra.theworths.org (Postfix) with ESMTPS id 39060429E26\r
+       for <notmuch@notmuchmail.org>; Mon,  9 May 2011 18:24:46 -0700 (PDT)\r
+Received: by fxm8 with SMTP id 8so4302837fxm.26\r
+       for <notmuch@notmuchmail.org>; Mon, 09 May 2011 18:24:44 -0700 (PDT)\r
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;\r
+       h=domainkey-signature:from:to:cc:subject:date:message-id:x-mailer\r
+       :in-reply-to:references;\r
+       bh=EgBLAgshfdXltEArdVpD1u+X53chFtddWFVDJnUDhpI=;\r
+       b=imtkDgpcB1/lyaSJdl0fOa3xkRSUCEVSnf/jgdnL9FukZcZtUiv32dYvtTsgOCb7Vj\r
+       cN7tEaS5QrMqjvzSSzL0aAp4H1zO5SoUlBM5e0Pywv3fxu03iSszgd65bcwpMXccdbTB\r
+       4l5PAznpGqjki/KE2vxLIdpkc1gd/kMf8V2fk=\r
+DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;\r
+       h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references;\r
+       b=nC2ZpoRz5Iku3z27ofZZUpYW4mb4yhYuquGp8ErUTsyFrduIX20U0BtMqI0irn0qD5\r
+       5df/7pH4V8AdPENyayeyXvqhbxtt3GMjTsHAEBIGo4OF0Dp0un6B7Bg7EFoPnZTAZOuG\r
+       4QvyHx8vVyGDi6e7ed+HkMN1+8Dej5ix6Ncno=\r
+Received: by 10.223.59.81 with SMTP id k17mr366749fah.94.1304990684851;\r
+       Mon, 09 May 2011 18:24:44 -0700 (PDT)\r
+Received: from localhost ([91.144.186.21])\r
+       by mx.google.com with ESMTPS id t15sm45904fau.0.2011.05.09.18.24.43\r
+       (version=TLSv1/SSLv3 cipher=OTHER);\r
+       Mon, 09 May 2011 18:24:44 -0700 (PDT)\r
+From: Dmitry Kurochkin <dmitry.kurochkin@gmail.com>\r
+To: Notmuch Mail <notmuch@notmuchmail.org>\r
+Subject: [PATCH] test: saving attachments from within emacs using\r
+       notmuch-show-save-part\r
+Date: Tue, 10 May 2011 05:24:49 +0400\r
+Message-Id: <1304990689-10933-1-git-send-email-dmitry.kurochkin@gmail.com>\r
+X-Mailer: git-send-email 1.7.5.1\r
+In-Reply-To: <1304990327-8665-1-git-send-email-dmitry.kurochkin@gmail.com>\r
+References: <1304990327-8665-1-git-send-email-dmitry.kurochkin@gmail.com>\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: Tue, 10 May 2011 01:24:47 -0000\r
+\r
+---\r
+Oops, the previos\r
+patch (id:"1304990327-8665-1-git-send-email-dmitry.kurochkin@gmail.com")\r
+has wrong title.\r
+\r
+s/notmuch-show-save-attachments/notmuch-show-save-part/\r
+\r
+Regards,\r
+  Dmitry\r
+\r
+ test/emacs |   14 +++++++++++---\r
+ 1 files changed, 11 insertions(+), 3 deletions(-)\r
+\r
+diff --git a/test/emacs b/test/emacs\r
+index 75dec89..675a887 100755\r
+--- a/test/emacs\r
++++ b/test/emacs\r
+@@ -112,9 +112,17 @@ Fcc: $(pwd)/mail/sent\r
+ On Fri, 29 Mar 1974 10:00:00 -0000, Notmuch Test Suite <test_suite@notmuchmail.org> wrote:\r
+ > This is a test that messages are sent via SMTP"\r
\r
+-test_begin_subtest "Save attachment from within emacs"\r
+-echo "./attachment" | test_emacs '(notmuch-show "id:cf0c4d610911171136h1713aa59w9cf9aa31f052ad0a@mail.gmail.com") (notmuch-show-save-attachments)' > /dev/null 2>&1\r
+-output=$(cat attachment)\r
++test_begin_subtest "Save attachment from within emacs using notmuch-show-save-attachments"\r
++# save as archive to test that Emacs does not re-compress .gz\r
++echo "./attachment1.gz" | test_emacs '(notmuch-show "id:cf0c4d610911171136h1713aa59w9cf9aa31f052ad0a@mail.gmail.com") (notmuch-show-save-attachments)' > /dev/null 2>&1\r
++output=$(cat attachment1.gz)\r
++expected=$(cat $EXPECTED/attachment)\r
++test_expect_equal "$output" "$expected"\r
++\r
++test_begin_subtest "Save attachment from within emacs using notmuch-show-save-part"\r
++# save as archive to test that Emacs does not re-compress .gz\r
++echo "./attachment2.gz" | test_emacs '(notmuch-show-save-part "id:cf0c4d610911171136h1713aa59w9cf9aa31f052ad0a@mail.gmail.com" 5)' > /dev/null 2>&1\r
++output=$(cat attachment2.gz)\r
+ expected=$(cat $EXPECTED/attachment)\r
+ test_expect_equal "$output" "$expected"\r
\r
+-- \r
+1.7.5.1\r
+\r