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 CDA3C431FAF for ; Sun, 19 Feb 2012 13:04:40 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: 0 X-Spam-Level: X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none] 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 mch18Op+imyJ for ; Sun, 19 Feb 2012 13:04:40 -0800 (PST) Received: from guru.guru-group.fi (guru-group.fi [87.108.86.66]) by olra.theworths.org (Postfix) with ESMTP id 0815F431FAE for ; Sun, 19 Feb 2012 13:04:40 -0800 (PST) Received: by guru.guru-group.fi (Postfix, from userid 501) id 0D9DB68055; Sun, 19 Feb 2012 23:04:38 +0200 (EET) From: Tomi Ollila To: Pieter Praet , Notmuch Mail Subject: Re: [PATCH v2 2/4] test: emacs: new test "notmuch-search: replying to a thread (sending)" In-Reply-To: <1329683908-5435-3-git-send-email-pieter@praet.org> References: <1310313335-4159-1-git-send-email-pieter@praet.org> <1329683908-5435-1-git-send-email-pieter@praet.org> <1329683908-5435-3-git-send-email-pieter@praet.org> User-Agent: Notmuch/0.11.1+198~g922c4d2 (http://notmuchmail.org) Emacs/23.3.1 (x86_64-unknown-linux-gnu) X-Face: HhBM'cA~ MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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: Sun, 19 Feb 2012 21:04:40 -0000 On Sun, 19 Feb 2012 21:38:26 +0100, Pieter Praet 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 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 The above part smells like CopyPasteProgramming; (old version of) emacs_deliver_message copied (old as this version is lacking opportunistic quit). Maybe the functionality of emacs_deliver_message needs to be split into 3 parts: initialization, sending and finalization. then other uses can use initialization and finalization parts and provide their own sending part. I have work-in-progress code for initialization and finalization parts of that and I don't want to do the changes in 2 places... Tomi