Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(15)  |  Call(15)  |  Derive(0)  |  Import(0)
Always returns a body if there is one.  If the message
is multipart then it returns the first part's body, if
it's not then it just returns the body.  If returns
None then this message has nothing for a body.

src/l/a/lamson-1.3.4/examples/librelist/tests/model/mailinglist_tests.py   lamson(Download)
    inmsg = MailRequest("fakepeer", None, None, str(sample))
    assert_equal(len(inmsg.all_parts()), 0)
    assert_equal(inmsg.body(), sample.Body)
 
    outmsg = craft_response(inmsg, list_name, list_name +

src/l/a/lamson-HEAD/examples/librelist/tests/model/mailinglist_tests.py   lamson(Download)
    inmsg = MailRequest("fakepeer", None, None, str(sample))
    assert_equal(len(inmsg.all_parts()), 0)
    assert_equal(inmsg.body(), sample.Body)
 
    outmsg = craft_response(inmsg, list_name, list_name +

src/s/a/salmon-mail-1/examples/librelist/tests/model/mailinglist_tests.py   salmon-mail(Download)
    inmsg = MailRequest("fakepeer", None, None, str(sample))
    assert_equal(len(inmsg.all_parts()), 0)
    assert_equal(inmsg.body(), sample.Body)
 
    outmsg = craft_response(inmsg, list_name, list_name +

src/l/o/lookout-HEAD/tests/email/model/alert_tests.py   lookout(Download)
    """
    alertsmsg = MailRequest('fakepeer', sender, "alerts-1@lookoutthere.com", open(home("tests/data/emails/alerts.msg")).read())
    stubs = alerts.get_html_stubs(alertsmsg.body())
    assert len(stubs) == 26
 
def test_get_remove_url():
    alertsmsg = MailRequest('fakepeer', sender, "alerts-1@lookoutthere.com", open(home("tests/data/emails/alerts.msg")).read())
    url = alerts.get_remove_url(alertsmsg.body())
    assert url == "/alerts/remove?s=AB2Xq4jsDy4ienBZYuYgWbzBWQ5i6LiD5L4y8JY&hl=en&gl=us&source=alertsmail&cd=4Ya67t6E3e4&cad=:s7:f1:v1:"
 
    msg = MailRequest('fakepeer', sender, "alerts-1@lookoutthere.com", open(home("tests/data/emails/confirmation.msg")).read())
    url = alerts.get_remove_url(msg.body())
    """
    alertsmsg = MailRequest('fakepeer', sender, "alerts-1@lookoutthere.com", open(home("tests/data/emails/alerts.msg")).read())
    stub = alerts.get_html_stubs(alertsmsg.body())[1]
    alert = alerts.get_raw_alert(stub)
    assert alert.has_key('blurb')
    alert['url'] == "http://www.chicagotribune.com/news/local/blagojevich/ct-met-blagojevich-trial-0704-20100704,0,3385819.story"
 
    stub = alerts.get_html_stubs(alertsmsg.body())[0]
    alert = alerts.get_raw_alert(stub)
    assert alert['byline'] == ""

src/l/i/librelist-HEAD/tests/model/mailinglist_tests.py   librelist(Download)
    inmsg = MailRequest("fakepeer", None, None, str(sample))
    assert_equal(len(inmsg.all_parts()), 0)
    assert_equal(inmsg.body(), sample.Body)
 
    outmsg = craft_response(inmsg, list_name, list_name +

src/l/a/lamson-HEAD/tests/lamson_tests/message_tests.py   lamson(Download)
    # python drops chars at the end, so can't compare equally
    assert readme.startswith(msg_parts[1].body)
    assert msg.body() == sample_parts[0].body
 
    # test that we get at least one message for messages without attachments
    sample = test_mail_response_plain_text()
    msg = mail.MailRequest("localhost", None, None, str(sample))
    msg_parts = msg.all_parts()
    assert len(msg_parts) == 0, "Length is %d should be 0." % len(msg_parts)
    assert msg.body()

src/l/a/lamson-1.3.4/tests/lamson_tests/message_tests.py   lamson(Download)
    # python drops chars at the end, so can't compare equally
    assert readme.startswith(msg_parts[1].body)
    assert msg.body() == sample_parts[0].body
 
    # test that we get at least one message for messages without attachments
    sample = test_mail_response_plain_text()
    msg = mail.MailRequest("localhost", None, None, str(sample))
    msg_parts = msg.all_parts()
    assert len(msg_parts) == 0, "Length is %d should be 0." % len(msg_parts)
    assert msg.body()