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

All Samples(10)  |  Call(8)  |  Derive(0)  |  Import(2)

src/f/l/flanker-0.4.14/tests/mime/message/headers/encoding_test.py   flanker(Download)
 
from flanker.mime.message import headers
from flanker.mime.message.headers.encoding import (encode_unstructured,
                                                   encode_string)
from flanker.mime.message import part
 
        eq_(Header(ascii_subject.encode("ascii"), "ascii", header_name="Subject"),
            encode_unstructured("Subject", ascii_subject))
 
    with patch.object(
        headers.encoding, 'MAX_HEADER_LENGTH', len(unicode_subject) + 1):
 
        eq_(Header(unicode_subject.encode("utf-8"), "utf-8", header_name="Subject"),
            encode_unstructured("Subject", unicode_subject))
 
        eq_(ascii_subject.encode("utf-8"),
            encode_unstructured("Subject", ascii_subject))
 
        eq_(unicode_subject.encode("utf-8"),
            encode_unstructured("Subject", unicode_subject))

src/f/l/flanker-HEAD/tests/mime/message/headers/encoding_test.py   flanker(Download)
 
from flanker.mime.message import headers
from flanker.mime.message.headers.encoding import (encode_unstructured,
                                                   encode_string)
from flanker.mime.message import part
 
        eq_(Header(ascii_subject.encode("ascii"), "ascii", header_name="Subject"),
            encode_unstructured("Subject", ascii_subject))
 
    with patch.object(
        headers.encoding, 'MAX_HEADER_LENGTH', len(unicode_subject) + 1):
 
        eq_(Header(unicode_subject.encode("utf-8"), "utf-8", header_name="Subject"),
            encode_unstructured("Subject", unicode_subject))
 
        eq_(ascii_subject.encode("utf-8"),
            encode_unstructured("Subject", ascii_subject))
 
        eq_(unicode_subject.encode("utf-8"),
            encode_unstructured("Subject", unicode_subject))