File: email_test.py

package info (click to toggle)
python-flanker 0.9.15-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 17,976 kB
  • sloc: python: 9,308; makefile: 4
file content (17 lines) | stat: -rw-r--r-- 581 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
from nose.tools import eq_

from flanker import _email


def test_encode_header_maxlinelen():
    """
    If the encoded string is longer then the maximum line length, which is 76,
    by default then it is broken down into lines. But a maximum line length
    value can be provided in the `maxlinelen` parameter.
    """
    eq_('very\r\n l' + ('o' * 70) + 'ng',
        _email.encode_header(None, 'very l' + ('o' * 70) + 'ng'))

    eq_('very l' + ('o' * 70) + 'ng',
        _email.encode_header(None, 'very l' + ('o' * 70) + 'ng',
                             max_line_len=78))