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

All Samples(192)  |  Call(188)  |  Derive(0)  |  Import(4)

src/f/l/flanker-0.4.14/flanker/mime/create.py   flanker(Download)
def from_string(string):
    return scanner.scan(string)
 
 
def from_python(message):

src/f/l/flanker-HEAD/flanker/mime/create.py   flanker(Download)
def from_string(string):
    return scanner.scan(string)
 
 
def from_python(message):

src/f/l/flanker-0.4.14/tests/mime/message/scanner_test.py   flanker(Download)
# coding:utf-8
from nose.tools import *
from mock import *
from flanker.mime.message.scanner import scan, ContentType, Boundary
from flanker.mime.message.errors import DecodingError
def no_ctype_headers_and_and_boundaries_test():
    """We are ok, when there is no content type and boundaries"""
    message = scan(NO_CTYPE)
    eq_(C('text', 'plain', dict(charset='ascii')), message.content_type)
    pmessage = message_from_string(NO_CTYPE)
def multipart_message_test():
    message = scan(EIGHT_BIT)
    pmessage = message_from_string(EIGHT_BIT)
 
    eq_(C('multipart', 'alternative', dict(boundary='=-omjqkVTVbwdgCWFRgIkx')),
def enclosed_message_test():
    message = scan(ENCLOSED)
    pmessage = message_from_string(ENCLOSED)
 
    eq_(C('multipart', 'mixed',
def torture_message_test():
    message = scan(TORTURE)
    tree = tree_to_string(message).splitlines()
    expected = TORTURE_PARTS.splitlines()
    eq_(len(tree), len(expected))

src/f/l/flanker-HEAD/tests/mime/message/scanner_test.py   flanker(Download)
# coding:utf-8
from nose.tools import *
from mock import *
from flanker.mime.message.scanner import scan, ContentType, Boundary
from flanker.mime.message.errors import DecodingError
def no_ctype_headers_and_and_boundaries_test():
    """We are ok, when there is no content type and boundaries"""
    message = scan(NO_CTYPE)
    eq_(C('text', 'plain', dict(charset='ascii')), message.content_type)
    pmessage = message_from_string(NO_CTYPE)
def multipart_message_test():
    message = scan(EIGHT_BIT)
    pmessage = message_from_string(EIGHT_BIT)
 
    eq_(C('multipart', 'alternative', dict(boundary='=-omjqkVTVbwdgCWFRgIkx')),
def enclosed_message_test():
    message = scan(ENCLOSED)
    pmessage = message_from_string(ENCLOSED)
 
    eq_(C('multipart', 'mixed',
def torture_message_test():
    message = scan(TORTURE)
    tree = tree_to_string(message).splitlines()
    expected = TORTURE_PARTS.splitlines()
    eq_(len(tree), len(expected))

src/f/l/flanker-0.4.14/tests/mime/message/part_test.py   flanker(Download)
from mock import *
from flanker.mime.create import multipart, text
from flanker.mime.message.scanner import scan
from flanker.mime.message.errors import EncodingError, DecodingError
from email import message_from_string
def readonly_immutability_test():
    """We can read the headers and access the body without changing a single
    char inside the message"""
 
    message = scan(BILINGUAL)
    eq_(BILINGUAL, message.to_string())
 
    message = scan(ENCLOSED)
    pmessage = message_from_string(ENCLOSED)
 
def top_level_headers_immutability_test():
    """We can change the headers without changing the body"""
    message = scan(ENCLOSED)
    message.headers['Subject'] = u'☯Привет! Как дела? Что делаешь?☯'
    out = message.to_string()
def immutability_test():
    """We can read the headers without changing a single
    char inside the message"""
    message = scan(BILINGUAL)
    eq_(u"Simple text. How are you? Как ты поживаешь?",

src/f/l/flanker-HEAD/tests/mime/message/part_test.py   flanker(Download)
from mock import *
from flanker.mime.create import multipart, text
from flanker.mime.message.scanner import scan
from flanker.mime.message.errors import EncodingError, DecodingError
from email import message_from_string
def readonly_immutability_test():
    """We can read the headers and access the body without changing a single
    char inside the message"""
 
    message = scan(BILINGUAL)
    eq_(BILINGUAL, message.to_string())
 
    message = scan(ENCLOSED)
    pmessage = message_from_string(ENCLOSED)
 
def top_level_headers_immutability_test():
    """We can change the headers without changing the body"""
    message = scan(ENCLOSED)
    message.headers['Subject'] = u'☯Привет! Как дела? Что делаешь?☯'
    out = message.to_string()
def immutability_test():
    """We can read the headers without changing a single
    char inside the message"""
    message = scan(BILINGUAL)
    eq_(u"Simple text. How are you? Как ты поживаешь?",