summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorLukas Fleischer <lfleischer@archlinux.org>2020-08-27 13:11:17 +0200
committerLukas Fleischer <lfleischer@archlinux.org>2020-08-27 13:19:57 +0200
commitc4f4ac510be1898e6969d13dd4f37c0a3f807aff (patch)
treebe3e918b04c0dfbb9f19b6ad893bb956f8106fd4 /test
parent03a6fa2f7ec927625c64f980c3408ed395a9dcfc (diff)
downloadaur-c4f4ac510be1898e6969d13dd4f37c0a3f807aff.tar.gz
aur-c4f4ac510be1898e6969d13dd4f37c0a3f807aff.tar.xz
Deliver emails to Cc in smtplib code path
When using the sendmail() function with smtplib.SMTP or smtplib.SMTP_SSL, the list of actual recipients for the email (to be translated to RCPT commands) has to be provided as a parameter. Update the notification script and add all Cc recipients to that parameter. Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
Diffstat (limited to 'test')
-rwxr-xr-xtest/t2500-notify.t16
1 files changed, 13 insertions, 3 deletions
diff --git a/test/t2500-notify.t b/test/t2500-notify.t
index 5ef64c18..713b31e3 100755
--- a/test/t2500-notify.t
+++ b/test/t2500-notify.t
@@ -277,13 +277,18 @@ test_expect_success 'Test subject and body of merge notifications.' '
test_cmp actual expected
'
-test_expect_success 'Test subject and body of request open notifications.' '
+test_expect_success 'Test Cc, subject and body of request open notifications.' '
cat <<-EOD | sqlite3 aur.db &&
/* Use package request IDs which can be distinguished from other IDs. */
- INSERT INTO PackageRequests (ID, PackageBaseID, PackageBaseName, UsersID, ReqTypeID, Comments, ClosureComment) VALUES (3001, 1001, "foobar", 1, 1, "This is a request test comment.", "");
+ INSERT INTO PackageRequests (ID, PackageBaseID, PackageBaseName, UsersID, ReqTypeID, Comments, ClosureComment) VALUES (3001, 1001, "foobar", 2, 1, "This is a request test comment.", "");
EOD
>sendmail.out &&
"$NOTIFY" request-open 1 3001 orphan 1001 &&
+ grep ^Cc: sendmail.out >actual &&
+ cat <<-EOD >expected &&
+ Cc: user@localhost, tu@localhost
+ EOD
+ test_cmp actual expected &&
grep ^Subject: sendmail.out >actual &&
cat <<-EOD >expected &&
Subject: [PRQ#3001] Orphan Request for foobar
@@ -324,9 +329,14 @@ test_expect_success 'Test subject and body of request open notifications for mer
test_cmp actual expected
'
-test_expect_success 'Test subject and body of request close notifications.' '
+test_expect_success 'Test Cc, subject and body of request close notifications.' '
>sendmail.out &&
"$NOTIFY" request-close 1 3001 accepted &&
+ grep ^Cc: sendmail.out >actual &&
+ cat <<-EOD >expected &&
+ Cc: user@localhost, tu@localhost
+ EOD
+ test_cmp actual expected &&
grep ^Subject: sendmail.out >actual &&
cat <<-EOD >expected &&
Subject: [PRQ#3001] Deletion Request for foobar Accepted