本文整理匯總了Python中mailpile.Mailpile.message_update_send方法的典型用法代碼示例。如果您正苦於以下問題:Python Mailpile.message_update_send方法的具體用法?Python Mailpile.message_update_send怎麽用?Python Mailpile.message_update_send使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類mailpile.Mailpile
的用法示例。
在下文中一共展示了Mailpile.message_update_send方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: assert
# 需要導入模塊: from mailpile import Mailpile [as 別名]
# 或者: from mailpile.Mailpile import message_update_send [as 別名]
'from': [MY_FROM],
'bcc': ['[email protected]'],
'mid': [new_mid],
'subject': ['This the TESTMSG subject'],
'body': ['Hello world!']
}
mp.message_update(**msg_data)
assert(mp.search('tag:drafts').result['stats']['count'] == 1)
assert(mp.search('tag:blank').result['stats']['count'] == 0)
assert(mp.search('TESTMSG').result['stats']['count'] == 0)
assert(not os.path.exists(mailpile_sent))
# Send the message (moves from Draft to Sent, is findable via. search)
del msg_data['subject']
msg_data['body'] = ['Hello world: thisisauniquestring :)']
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)