From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 37457431FD0 for ; Fri, 13 May 2011 08:08:09 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -0.7 X-Spam-Level: X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5 tests=[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 h5472bd19Aon for ; Fri, 13 May 2011 08:08:08 -0700 (PDT) Received: from mail-wy0-f181.google.com (mail-wy0-f181.google.com [74.125.82.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id 65AD0431FB6 for ; Fri, 13 May 2011 08:08:08 -0700 (PDT) Received: by wyi11 with SMTP id 11so2198850wyi.26 for ; Fri, 13 May 2011 08:08:07 -0700 (PDT) Received: by 10.216.142.133 with SMTP id i5mr1560209wej.43.1305299286790; Fri, 13 May 2011 08:08:06 -0700 (PDT) Received: from localhost (54.209-242-81.adsl-dyn.isp.belgacom.be [81.242.209.54]) by mx.google.com with ESMTPS id y35sm1190543weq.39.2011.05.13.08.08.05 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 13 May 2011 08:08:05 -0700 (PDT) From: Pieter Praet To: Notmuch Mail Subject: [PATCH 1/3] test: emacs: add subtest "Send reply from within Emacs" Date: Fri, 13 May 2011 17:07:48 +0200 Message-Id: <1305299270-4316-1-git-send-email-pieter@praet.org> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1305275652-22956-1-git-send-email-pieter@praet.org> References: <1305275652-22956-1-git-send-email-pieter@praet.org> 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, 13 May 2011 15:08:09 -0000 Renamed subtest "Reply within emacs" to "Compose reply in emacs" as it doesn't really "do" a reply, but rather populates a reply buffer and then princ's it. ... and couldn't possibly justify that without writing an actual reply test. Signed-off-by: Pieter Praet --- test/emacs | 33 ++++++++++++++++++++++++++++++++- 1 files changed, 32 insertions(+), 1 deletions(-) diff --git a/test/emacs b/test/emacs index 3264bf2..18d8322 100755 --- a/test/emacs +++ b/test/emacs @@ -99,7 +99,7 @@ notmuch new > /dev/null output=$(notmuch search 'subject:"testing message sent via SMTP"' | notmuch_search_sanitize) test_expect_equal "$output" "thread:XXX 1974-03-29 [1/1] Notmuch Test Suite; Testing message sent via SMTP (inbox)" -test_begin_subtest "Reply within emacs" +test_begin_subtest "Compose reply in emacs" # We sed away everything before the ^From in the output to avoid getting # confused by messages such as "Parsing /home/cworth/.mailrc... done" output=$(test_emacs '(notmuch-search "subject:\"testing message sent via SMTP\"") (notmuch-test-wait) (notmuch-search-reply-to-thread) (princ (buffer-string))' | sed -ne '/^From/,$ p' | sed -e 's/^In-Reply-To: <.*>$/In-Reply-To: /') @@ -112,6 +112,37 @@ 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 "Send reply from within Emacs" +../smtp-dummy sent_message & +smtp_dummy_pid=$! + +test_emacs '(setq message-send-mail-function '\''message-smtpmail-send-it) (setq smtpmail-smtp-server "localhost") (setq smtpmail-smtp-service "25025") (notmuch-search "subject:\"testing message sent via SMTP\"") (notmuch-test-wait) (notmuch-search-reply-to-thread) (message-goto-to) (message-goto-body) (end-of-buffer) (newline) (insert "Reply to a message via Emacs with fake SMTP") (message-send-and-exit)' >/dev/null 2>&1 +wait ${smtp_dummy_pid} + +output=$(sed \ + -e s',^User-Agent: Notmuch/.* Emacs/.*,User-Agent: Notmuch/XXX Emacs/XXX,' \ + -e s',^Message-ID: <.*>$,Message-ID: ,' \ + -e s',^In-Reply-To: <.*>$,In-Reply-To: ,' \ + -e s',^References: <.*>$,References: ,' \ + -e s',^Date: .*$,Date: Fri\, 29 Mar 1974 10:05:00 -0000,' < sent_message) +test_expect_equal "$output" "From: Notmuch Test Suite +To: user@example.com +Subject: Re: Testing message sent via SMTP +In-Reply-To: +References: +User-Agent: Notmuch/XXX Emacs/XXX +Date: Fri, 29 Mar 1974 10:05:00 -0000 +Message-ID: +MIME-Version: 1.0 +Content-Type: text/plain; charset=us-ascii + +On Fri, 29 Mar 1974 10:00:00 -0000, Notmuch Test Suite wrote: +> This is a test that messages are sent via SMTP + +Reply to a message via Emacs with fake 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) -- 1.7.4.1