當前位置: 首頁>>代碼示例>>Python>>正文


Python Mailpile.message_send方法代碼示例

本文整理匯總了Python中mailpile.Mailpile.message_send方法的典型用法代碼示例。如果您正苦於以下問題:Python Mailpile.message_send方法的具體用法?Python Mailpile.message_send怎麽用?Python Mailpile.message_send使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在mailpile.Mailpile的用法示例。


在下文中一共展示了Mailpile.message_send方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: assert

# 需要導入模塊: from mailpile import Mailpile [as 別名]
# 或者: from mailpile.Mailpile import message_send [as 別名]
    assert(mp.search('tag:blank').result['stats']['count'] == 0)
    assert('the TESTMSG subject' in contents(mailpile_sent))
    assert('thisisauniquestring' in contents(mailpile_sent))
    assert(MY_FROM in grep('X-Args', mailpile_sent))
    assert('[email protected]' in grep('X-Args', mailpile_sent))
    assert('[email protected]' not in grepv('X-Args', mailpile_sent))
    for search in (['tag:sent'],
                   ['bcc:[email protected]'],
                   ['thisisauniquestring'],
                   ['subject:TESTMSG']):
        say('Searching for: %s' % search)
        assert(mp.search(*search).result['stats']['count'] == 1)
    os.remove(mailpile_sent)

    # Test the send method's "bounce" capability
    mp.message_send(mid=[new_mid], to=['[email protected]'])
    mp.sendmail()
    assert('thisisauniquestring' in contents(mailpile_sent))
    assert('OpenPGP: id=CF5E' in contents(mailpile_sent))
    assert('; preference=encrypt' in contents(mailpile_sent))
    assert('[email protected]' not in grepv('X-Args', mailpile_sent))
    assert('-i [email protected]' in contents(mailpile_sent))

    say("Tests passed, woot!")
except:
    say("Tests FAILED!")
    print
    traceback.print_exc()


##[ Interactive mode ]########################################################
開發者ID:crameth,項目名稱:Mailpile,代碼行數:33,代碼來源:mailpile-test.py

示例2: contents

# 需要導入模塊: from mailpile import Mailpile [as 別名]
# 或者: from mailpile.Mailpile import message_send [as 別名]
    mp.message_update_send(**msg_data)
    mp.sendmail()
    assert mp.search("tag:drafts").result["stats"]["count"] == 0
    assert mp.search("tag:blank").result["stats"]["count"] == 0
    assert "the TESTMSG subject" in contents(mailpile_sent)
    assert "thisisauniquestring" in contents(mailpile_sent)
    assert MY_FROM in grep("X-Args", mailpile_sent)
    assert "[email protected]" in grep("X-Args", mailpile_sent)
    assert "[email protected]" not in grepv("X-Args", mailpile_sent)
    for search in (["tag:sent"], ["bcc:[email protected]"], ["thisisauniquestring"], ["subject:TESTMSG"]):
        say("Searching for: %s" % search)
        assert mp.search(*search).result["stats"]["count"] == 1
    os.remove(mailpile_sent)

    # Test the send method's "bounce" capability
    mp.message_send(mid=[new_mid], to=["[email protected]"])
    mp.sendmail()
    assert "thisisauniquestring" in contents(mailpile_sent)
    assert "[email protected]" not in grepv("X-Args", mailpile_sent)
    assert "-i [email protected]" in contents(mailpile_sent)

    say("Tests passed, woot!")
except:
    say("Tests FAILED!")
    print
    traceback.print_exc()


##[ Interactive mode ]########################################################

if "-i" in sys.argv:
開發者ID:vinchu,項目名稱:Mailpile,代碼行數:33,代碼來源:mailpile-test.py


注:本文中的mailpile.Mailpile.message_send方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。