Exemple #1
0
def test_mail_for_state_w_notification():
    job.notify = ['*****@*****.**']
    msg, rcpt = mail_for_state(job, 'ok', ok_result)
    txt = msg.as_string()
    assert rcpt == ['*****@*****.**'], repr(rcpt)
    assert '\n  Hello, World!\n' in txt, txt
    assert msg['Subject'] == '[foo@snafu/bar] ok', msg['Subject']
Exemple #2
0
def test_mail_for_state_w_notification():
    job.notify = ['*****@*****.**']
    msg, rcpt = mail_for_state(job, 'ok', ok_result)
    txt = msg.get_payload(decode=True)
    assert rcpt == ['*****@*****.**'], repr(rcpt)
    assert '\n  Hello, World! With some' in txt, txt
    assert msg['Subject'] == '[foo@snafu/bar] ok', msg['Subject']
Exemple #3
0
def test_mail_for_state():
    with devops_mail_patch:
        msg, rcpt = mail_for_state(job, 'ok', ok_result)
    txt = msg.as_string()
    assert rcpt == ['*****@*****.**'], repr(rcpt)
    assert '\n  Hello, World!\n' in txt, txt
    assert msg['Subject'] == '[foo@snafu/bar] ok', msg['Subject']
Exemple #4
0
def test_mail_for_state():
    with devops_mail_patch:
        msg, rcpt = mail_for_state(job, 'ok', ok_result)
    txt = msg.get_payload(decode=True)
    assert rcpt == ['*****@*****.**'], repr(rcpt)

    assert '\n  Hello, World! With some' in txt, txt
    assert msg['Subject'] == '[foo@snafu/bar] ok', msg['Subject']