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 CC82C429E31 for ; Mon, 9 May 2011 20:31:03 -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 g7NXj0GBrRTf for ; Mon, 9 May 2011 20:31:03 -0700 (PDT) Received: from mail-fx0-f53.google.com (mail-fx0-f53.google.com [209.85.161.53]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id 66944429E35 for ; Mon, 9 May 2011 20:31:01 -0700 (PDT) Received: by mail-fx0-f53.google.com with SMTP id 8so4348123fxm.26 for ; Mon, 09 May 2011 20:31:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references; bh=hKqZ8G5yBQi0qu1999du8WonHX4n5Pergzn2xIAv0Yc=; b=m9LlIAmeH3zUWMaBk8HE5Tk7qs+S6QaeUux1J0bh6lMK57kK6pmN31ue7og7TUfuOF 9Q00rYvSZp6O7vNPtWEQIkvFnaJL67lgIZKbGGODipuUZCGvdIQd8PAcXjWiKqLKJkq4 qAW/H04X2LsMHiabFnlAnL9q/90nWGhxOMztI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; b=Px9s1Tb5DmdDBiUWj/n6GopQ8NtbjGbGtdwmxc80L0QjFWQLglpivMzHEDLSivAlj8 v+nvvfJ0sEQT4UDK9mX/FSwxz/UzPC7jC2dLH33NhXvJlhvcLl1hnD5YcSBkEf9Ovvsd Nbe7kaqBobIOTrkGOrT/8n8/YgEbc/glwOu2I= Received: by 10.223.17.142 with SMTP id s14mr853218faa.145.1304998261111; Mon, 09 May 2011 20:31:01 -0700 (PDT) Received: from localhost ([91.144.186.21]) by mx.google.com with ESMTPS id s17sm707046fau.13.2011.05.09.20.30.59 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 09 May 2011 20:31:00 -0700 (PDT) From: Dmitry Kurochkin To: Notmuch Mail Subject: [PATCH 2/2] test: add test for saving attachments using notmuch-show-save-part Date: Tue, 10 May 2011 07:30:51 +0400 Message-Id: <1304998251-28700-3-git-send-email-dmitry.kurochkin@gmail.com> X-Mailer: git-send-email 1.7.5.1 In-Reply-To: <1304998251-28700-1-git-send-email-dmitry.kurochkin@gmail.com> References: <1304998251-28700-1-git-send-email-dmitry.kurochkin@gmail.com> 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: Tue, 10 May 2011 03:31:03 -0000 Use .gz filenames for saved attachments in the tests to check that Emacs does not re-compress the file. Use test_expect_equal_file instead of test_expect_equal to avoid binary output on the console. --- test/emacs | 14 +++++++++----- 1 files changed, 9 insertions(+), 5 deletions(-) diff --git a/test/emacs b/test/emacs index 75dec89..b376033 100755 --- a/test/emacs +++ b/test/emacs @@ -112,11 +112,15 @@ Fcc: $(pwd)/mail/sent On Fri, 29 Mar 1974 10:00:00 -0000, Notmuch Test Suite wrote: > This is a test that messages are sent via SMTP" -test_begin_subtest "Save attachment from within emacs" -echo "./attachment" | test_emacs '(notmuch-show "id:cf0c4d610911171136h1713aa59w9cf9aa31f052ad0a@mail.gmail.com") (notmuch-show-save-attachments)' > /dev/null 2>&1 -output=$(cat attachment) -expected=$(cat $EXPECTED/attachment) -test_expect_equal "$output" "$expected" +test_begin_subtest "Save attachment from within emacs using notmuch-show-save-attachments" +# save as archive to test that Emacs does not re-compress .gz +echo ./attachment1.gz | test_emacs '(notmuch-show "id:cf0c4d610911171136h1713aa59w9cf9aa31f052ad0a@mail.gmail.com") (notmuch-show-save-attachments)' > /dev/null 2>&1 +test_expect_equal_file "$EXPECTED/attachment" attachment1.gz + +test_begin_subtest "Save attachment from within emacs using notmuch-show-save-part" +# save as archive to test that Emacs does not re-compress .gz +echo ./attachment2.gz | test_emacs '(notmuch-show-save-part "id:cf0c4d610911171136h1713aa59w9cf9aa31f052ad0a@mail.gmail.com" 5)' > /dev/null 2>&1 +test_expect_equal_file "$EXPECTED/attachment" attachment2.gz test_begin_subtest "View raw message within emacs" expected=$(cat $EXPECTED/raw-message-cf0c4d-52ad0a) -- 1.7.5.1