unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Dmitry Kurochkin <dmitry.kurochkin@gmail.com>
To: Pieter Praet <pieter@praet.org>, Notmuch Mail <notmuch@notmuchmail.org>
Subject: Re: [PATCH v2 2/4] test: emacs: new test "notmuch-search: replying to a thread (sending)"
Date: Mon, 20 Feb 2012 16:44:32 +0400	[thread overview]
Message-ID: <87fwe5lln3.fsf@gmail.com> (raw)
In-Reply-To: <1329683908-5435-3-git-send-email-pieter@praet.org>

On Sun, 19 Feb 2012 21:38:26 +0100, Pieter Praet <pieter@praet.org> wrote:
> As pointed out in the previous commit, the test for replying from
> within Emacs didn't actually submit the reply. This one does.
> ---
>  test/emacs |   41 +++++++++++++++++++++++++++++++++++++++++
>  1 files changed, 41 insertions(+), 0 deletions(-)
> 
> diff --git a/test/emacs b/test/emacs
> index 308d749..0f4f42b 100755
> --- a/test/emacs
> +++ b/test/emacs
> @@ -273,6 +273,47 @@ On 01 Jan 2000 12:00:00 -0000, Notmuch Test Suite <test_suite@notmuchmail.org> w
>  EOF
>  test_expect_equal_file OUTPUT EXPECTED
>  
> +test_begin_subtest "notmuch-search: replying to a thread (sending)"
> +$TEST_DIRECTORY/smtp-dummy sent_message &
> +smtp_dummy_pid=$!
> +test_emacs \
> +'(let ((message-send-mail-function '\''message-smtpmail-send-it)
> +       (smtpmail-smtp-server "localhost")
> +       (smtpmail-smtp-service "25025"))
> +  (notmuch-search "subject:\"testing message sent via SMTP\"")
> +  (notmuch-test-wait)
> +  (notmuch-search-reply-to-thread)
> +  (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}
> +notmuch new >/dev/null
> +sed \
> +    -e s',^User-Agent: Notmuch/.* Emacs/.*,User-Agent: Notmuch/XXX Emacs/XXX,' \
> +    -e s',^Message-ID: <.*>$,Message-ID: <XXX>,' \
> +    -e s',^In-Reply-To: <.*>$,In-Reply-To: <XXX>,' \
> +    -e s',^References: <.*>$,References: <XXX>,' \
> +    -e s',^Date: .*$,Date: Fri\, 29 Mar 1974 10:05:00 -0000,' < sent_message >OUTPUT

This sed command is a (partial) copy past from "Sending a message via
(fake) SMTP" test.  I suggest adding notmuch_sent_message_sanitize
function which would replace common headers with XXX.

Replace Date with XXX for Date for consistency with other headers,
AFAICT a valid date value is not needed here.

Regards,
  Dmitry

> +cat <<EOF >EXPECTED
> +From: Notmuch Test Suite <test_suite@notmuchmail.org>
> +To: user@example.com
> +Subject: Re: Testing message sent via SMTP
> +In-Reply-To: <XXX>
> +References: <XXX>
> +User-Agent: Notmuch/XXX Emacs/XXX
> +Date: Fri, 29 Mar 1974 10:05:00 -0000
> +Message-ID: <XXX>
> +MIME-Version: 1.0
> +Content-Type: text/plain; charset=us-ascii
> +
> +On 01 Jan 2000 12:00:00 -0000, Notmuch Test Suite <test_suite@notmuchmail.org> wrote:
> +> This is a test that messages are sent via SMTP
> +
> +Reply to a message via Emacs with fake SMTP
> +EOF
> +test_expect_equal_file OUTPUT EXPECTED
> +
>  test_begin_subtest "Quote MML tags in reply"
>  message_id='test-emacs-mml-quoting@message.id'
>  add_message [id]="$message_id" \
> -- 
> 1.7.8.1
> 

  parent reply	other threads:[~2012-02-20 12:46 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-10 15:55 Extend test coverage wrt tagging Pieter Praet
2011-07-10 15:55 ` [PATCH 1/6] test: emacs: rename subtest "Reply within emacs" to "Compose reply in emacs" Pieter Praet
2011-07-10 15:55 ` [PATCH 2/6] test: emacs: add test for sending a reply from within Emacs Pieter Praet
2011-07-10 15:55 ` [PATCH 3/6] test: emacs: add test to verify that the message being replied to is tagged as such Pieter Praet
2011-07-10 15:55 ` [PATCH 4/6] test: emacs: add test for `notmuch-search-operate-all' Pieter Praet
2011-07-10 15:55 ` [PATCH 5/6] test: emacs: `notmuch-search-operate-all' should operate on threads, not messages Pieter Praet
2011-07-10 15:55 ` [PATCH 6/6] emacs: make `notmuch-search-operate-all' " Pieter Praet
2011-11-12 16:13   ` David Bremner
2011-11-12 16:35     ` Austin Clements
2011-11-16 13:55       ` Pieter Praet
2012-02-19 20:38 ` Pieter Praet
2012-02-19 20:38   ` [PATCH v2 1/4] test: emacs: rename subtest "Reply within emacs" Pieter Praet
2012-02-20 12:16     ` Dmitry Kurochkin
2012-02-19 20:38   ` [PATCH v2 2/4] test: emacs: new test "notmuch-search: replying to a thread (sending)" Pieter Praet
2012-02-19 21:04     ` Tomi Ollila
2012-02-22 18:49       ` Pieter Praet
2012-02-20 12:44     ` Dmitry Kurochkin [this message]
2012-02-22 18:51       ` Pieter Praet
2012-02-19 20:38   ` [PATCH v2 3/4] test: emacs: new test "notmuch-search: when reply is sent, parent message should be tagged 'replied'" Pieter Praet
2012-02-20 12:20     ` Dmitry Kurochkin
2012-02-22 18:52       ` Pieter Praet
2012-02-19 20:38   ` [PATCH v2 4/4] test: emacs: new test "notmuch-search: change tags of all matching messages" Pieter Praet
2012-02-19 21:08     ` Tomi Ollila
2012-02-22 18:53       ` Pieter Praet
2012-02-20 12:25     ` Dmitry Kurochkin
2012-02-22 18:53       ` Pieter Praet
2012-02-22 18:54     ` [PATCH v3] " Pieter Praet
2012-03-07 19:49       ` [PATCH v4] " Pieter Praet
2012-03-11 18:42         ` Tomi Ollila

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87fwe5lln3.fsf@gmail.com \
    --to=dmitry.kurochkin@gmail.com \
    --cc=notmuch@notmuchmail.org \
    --cc=pieter@praet.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).