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

All Samples(38)  |  Call(36)  |  Derive(0)  |  Import(2)

src/f/l/flanker-0.4.14/flanker/mime/__init__.py   flanker(Download)
from flanker.mime.message.errors import DecodingError, EncodingError, MimeError
from flanker.mime import create
from flanker.mime.create import from_string
from flanker.mime.message.fallback.create import from_string as recover
from flanker.mime.message.utils import python_message_to_string

src/f/l/flanker-HEAD/flanker/mime/__init__.py   flanker(Download)
from flanker.mime.message.errors import DecodingError, EncodingError, MimeError
from flanker.mime import create
from flanker.mime.create import from_string
from flanker.mime.message.fallback.create import from_string as recover
from flanker.mime.message.utils import python_message_to_string

src/f/l/flanker-0.4.14/tests/mime/message/create_test.py   flanker(Download)
def from_string_message_test():
    message = create.from_string(IPHONE)
    parts = list(message.walk())
    eq_(3, len(parts))
    eq_(u'\n\n\n~Danielle', parts[2].body)
 
 
def from_part_message_simple_test():
    message = create.from_string(IPHONE)
def create_singlepart_ascii_test():
    message = create.text("plain", u"Hello")
    message = create.from_string(message.to_string())
    eq_("7bit", message.content_encoding.value)
    eq_("Hello", message.body)
 
 
def create_singlepart_unicode_test():
    message = create.text("plain", u"Привет, курилка")
    message = create.from_string(message.to_string())
def create_singlepart_ascii_long_lines_test():
    very_long = "very long line  " * 1000 + "preserve my newlines \r\n\r\n"
    message = create.text("plain", very_long)
 
    message2 = create.from_string(message.to_string())

src/f/l/flanker-HEAD/tests/mime/message/create_test.py   flanker(Download)
def from_string_message_test():
    message = create.from_string(IPHONE)
    parts = list(message.walk())
    eq_(3, len(parts))
    eq_(u'\n\n\n~Danielle', parts[2].body)
 
 
def from_part_message_simple_test():
    message = create.from_string(IPHONE)
def create_singlepart_ascii_test():
    message = create.text("plain", u"Hello")
    message = create.from_string(message.to_string())
    eq_("7bit", message.content_encoding.value)
    eq_("Hello", message.body)
 
 
def create_singlepart_unicode_test():
    message = create.text("plain", u"Привет, курилка")
    message = create.from_string(message.to_string())
def create_singlepart_ascii_long_lines_test():
    very_long = "very long line  " * 1000 + "preserve my newlines \r\n\r\n"
    message = create.text("plain", very_long)
 
    message2 = create.from_string(message.to_string())

src/f/l/flanker-0.4.14/tests/mime/bounce_tests.py   flanker(Download)
def test_bounce_analyzer_on_bounce():
    bm = create.from_string(BOUNCE)
    ok_(bm.is_bounce())
    eq_('5.1.1', bm.bounce.status)
    ok_(bm.bounce.diagnostic_code)
 
 
def test_bounce_analyzer_on_regular():
    bm = create.from_string(SIGNED)
def test_bounce_no_headers_error_message():
    msg = create.from_string("Nothing")
    assert_false(msg.is_bounce())
 

src/f/l/flanker-HEAD/tests/mime/bounce_tests.py   flanker(Download)
def test_bounce_analyzer_on_bounce():
    bm = create.from_string(BOUNCE)
    ok_(bm.is_bounce())
    eq_('5.1.1', bm.bounce.status)
    ok_(bm.bounce.diagnostic_code)
 
 
def test_bounce_analyzer_on_regular():
    bm = create.from_string(SIGNED)
def test_bounce_no_headers_error_message():
    msg = create.from_string("Nothing")
    assert_false(msg.is_bounce())
 

src/f/l/flanker-HEAD/tests/mime/message/headers/encoding_test.py   flanker(Download)
def max_header_length_test():
    message = create.from_string(LONG_HEADER)
    # this used to fail because exceeded max depth recursion
    ok_(message.headers["Subject"].encode("utf-8") in message.to_string())
 

src/f/l/flanker-0.4.14/tests/mime/message/headers/encoding_test.py   flanker(Download)
def max_header_length_test():
    message = create.from_string(LONG_HEADER)
    # this used to fail because exceeded max depth recursion
    ok_(message.headers["Subject"].encode("utf-8") in message.to_string())