Unit Tests for send_mail
DoD
In the caosdb-advanced-tools repository:
-
check whether the send_mail
method correctly formats the mail (headers and body) -
check whether the send_mail
method calls the configuredsendmail
executable with the correct command line arguments. -
check whether the send_mail
method correctly handles an error in thesendmail
executable (raise exception and/or log the error).
Note: two minimal sendmail
executables are necessary. One is printing the email to a file (e.g. sendmail_to_file
) and reports all command line options, another terminates with a non-zero exit code.
See also
- caosdb/src/caosdb-deploy#86
- reuse code from caosdb/src/caosdb-deploy!82
Edited by Timm Fitschen