dovecot-2.0-pigeonhole: test suite: added test for usage of vari...

pigeonhole at rename-it.nl pigeonhole at rename-it.nl
Wed Sep 21 02:05:13 EEST 2011


details:   http://hg.rename-it.nl/dovecot-2.0-pigeonhole/rev/4353ad991f1c
changeset: 1536:4353ad991f1c
user:      Stephan Bosch <stephan at rename-it.nl>
date:      Wed Sep 21 00:54:52 2011 +0200
description:
test suite: added test for usage of variables in vacation command.

diffstat:

 tests/extensions/vacation/message.svtest |  44 ++++++++++++++++++++++
 1 files changed, 44 insertions(+), 0 deletions(-)

diffs (57 lines):

diff -r b4f0fe1f54c3 -r 4353ad991f1c tests/extensions/vacation/message.svtest
--- a/tests/extensions/vacation/message.svtest	Sat Sep 17 09:04:55 2011 +0200
+++ b/tests/extensions/vacation/message.svtest	Wed Sep 21 00:54:52 2011 +0200
@@ -1,5 +1,7 @@
 require "vnd.dovecot.testsuite";
 require "vacation";
+require "variables";
+require "body";
 
 test_set "message" text:
 From: stephan at example.org
@@ -46,3 +48,45 @@
 		test_fail "in-reply-to header set incorrectly";
 	}
 }
+
+test_result_reset;
+
+test_set "message" text:
+From: stephan at example.org
+Subject: frop
+References: <1234 at local.machine.example> <3456 at example.net>
+ <435444 at ttms.example.org> <4223 at froop.example.net> <m345444444 at message-id.exp>
+Message-ID: <432df324 at example.org>
+To: nico at frop.example.org
+
+Frop
+.
+;
+
+test "Variables" {
+	set "message" "I am not in today!";
+	set "subject" "Out of office";
+	set "from" "user at example.com";
+
+	vacation :from "${from}" :subject "${subject}" "${message}";
+
+	test_result_print;
+
+	if not test_result_execute {
+		test_fail "execution of result failed";
+	}
+
+	test_message :smtp 0;
+
+	if not header :contains "subject" "Out of office" {
+		test_fail "subject not set properly";
+	}
+
+	if not header :contains "from" "user at example.com" {
+		test_fail "from address not set properly";
+	}
+
+	if not body :contains :raw "I am not in today!" {
+		test_fail "message not set properly";
+	}
+}


More information about the dovecot-cvs mailing list