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 01A8A429E4A for ; Mon, 27 Jun 2011 21:45:52 -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 HjB72jxnMKYf for ; Mon, 27 Jun 2011 21:45:50 -0700 (PDT) Received: from mail-bw0-f53.google.com (mail-bw0-f53.google.com [209.85.214.53]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id 9B3CC421167 for ; Mon, 27 Jun 2011 21:45:43 -0700 (PDT) Received: by mail-bw0-f53.google.com with SMTP id 12so4889638bwg.26 for ; Mon, 27 Jun 2011 21:45:43 -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=U6dv3iz9dDzB5rTWhH+TaYXiEjWXUD6wx7+GbykXkqA=; b=UK9emUzGoUM+Lmt4wNIAf7SvF7b6n/M2h9ynKW9WSQmbA0aO3VCZoP4jSEvAEjc5JR wmENDjUkV5TrYmHX//9qICRJYrUgSFSS+mhrPBMbG6n4JrRJzz9/4qri/9vqL/4NIXkd jWgz2K9gFz5K5NGPH9ylaSuiJz/TsxhpzLGmI= 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=dOdMv+AH8G51bDwaeY3uVi1iQSOWY3o7vQS0K1q4nsLWTKiaCnhd8NFcgmAJ4xp1Wz Rf/7bqE9tvOPwZUUKSEEQ1HYQamflueEIcFgmes8OX+Lm4wW5xlG97NTjMO4SA9aL1yQ f/IWHcre6+t2dlP5/g5QGRn46EbMcWe75nxMI= Received: by 10.204.32.207 with SMTP id e15mr5104137bkd.60.1309236343321; Mon, 27 Jun 2011 21:45:43 -0700 (PDT) Received: from localhost ([91.144.186.21]) by mx.google.com with ESMTPS id o3sm1547386bka.0.2011.06.27.21.45.42 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 27 Jun 2011 21:45:42 -0700 (PDT) From: Dmitry Kurochkin To: notmuch@notmuchmail.org Subject: [PATCH 07/10] test: use emacs_deliver_message in Emacs SMTP send test Date: Tue, 28 Jun 2011 08:45:08 +0400 Message-Id: <1309236311-2162-7-git-send-email-dmitry.kurochkin@gmail.com> X-Mailer: git-send-email 1.7.5.4 In-Reply-To: <1309236311-2162-1-git-send-email-dmitry.kurochkin@gmail.com> References: <1309236311-2162-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, 28 Jun 2011 04:45:52 -0000 Minor changes to expected results of other Emacs tests were needed because the message Date header changed. --- test/emacs | 34 +++++++++------------------------- 1 files changed, 9 insertions(+), 25 deletions(-) diff --git a/test/emacs b/test/emacs index 4592005..409e033 100755 --- a/test/emacs +++ b/test/emacs @@ -118,28 +118,12 @@ output=$(notmuch search 'id:"123..456@example"' | notmuch_search_sanitize) test_expect_equal "$output" "thread:XXX 2001-01-05 [1/1] Notmuch Test Suite; Message with .. in Message-Id (inbox search-add show-add)" test_begin_subtest "Sending a message via (fake) SMTP" - -# Before we can send a message, we have to prepare the FCC maildir -mkdir -p mail/sent/cur -mkdir -p mail/sent/new -mkdir -p mail/sent/tmp - -../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-hello) - (notmuch-mua-mail) - (message-goto-to) - (insert \"user@example.com\nDate: Fri, 29 Mar 1974 10:00:00 -0000\") - (message-goto-subject) - (insert \"Testing message sent via SMTP\") - (message-goto-body) - (insert \"This is a test that messages are sent via SMTP\") - (message-send-and-exit)" >/dev/null 2>&1 -wait ${smtp_dummy_pid} - +emacs_deliver_message \ + 'Testing message sent via SMTP' \ + 'This is a test that messages are sent via SMTP' \ + '(message-goto-to) + (kill-whole-line) + (insert "To: user@example.com\n")' sed \ -e s',^User-Agent: Notmuch/.* Emacs/.*,User-Agent: Notmuch/XXX Emacs/XXX,' \ -e s',^Message-ID: <.*>$,Message-ID: ,' < sent_message >OUTPUT @@ -147,7 +131,7 @@ cat <EXPECTED From: Notmuch Test Suite To: user@example.com Subject: Testing message sent via SMTP -Date: Fri, 29 Mar 1974 10:00:00 -0000 +Date: 01 Jan 2000 12:00:00 -0000 User-Agent: Notmuch/XXX Emacs/XXX Message-ID: MIME-Version: 1.0 @@ -160,7 +144,7 @@ test_expect_equal_file OUTPUT EXPECTED test_begin_subtest "Verify that sent messages are saved/searchable (via FCC)" 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_expect_equal "$output" "thread:XXX 2000-01-01 [1/1] Notmuch Test Suite; Testing message sent via SMTP (inbox)" test_begin_subtest "notmuch-fcc-dirs set to nil" test_emacs "(setq notmuch-fcc-dirs nil) @@ -262,7 +246,7 @@ Subject: Re: Testing message sent via SMTP In-Reply-To: Fcc: $(pwd)/mail/sent --text follows this line-- -On Fri, 29 Mar 1974 10:00:00 -0000, Notmuch Test Suite wrote: +On 01 Jan 2000 12:00:00 -0000, Notmuch Test Suite wrote: > This is a test that messages are sent via SMTP EOF test_expect_equal_file OUTPUT EXPECTED -- 1.7.5.4