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

All Samples(63)  |  Call(61)  |  Derive(0)  |  Import(2)

src/f/l/flanker-0.4.14/tests/addresslib/parser_address_list_test.py   flanker(Download)
def run_relaxed_test(string, expected_mlist, expected_unpar):
    mlist, unpar = address.parse_list(string, strict=False, as_tuple=True)
    assert_equal(mlist, expected_mlist)
    assert_equal(unpar, expected_unpar)
 
@nottest
def run_strict_test(string, expected_mlist):
    mlist = address.parse_list(string, strict=True)
def test_simple_valid():
    s = '''http://foo.com:8080; "Ev K." <ev@host.com>, "Alex K" alex@yahoo.net, "Tom, S" "tom+[a]"@s.com'''
    addrs = address.parse_list(s)
 
    assert_equal(4, len(addrs))
 
    s = '''"Allan G\'o"  <allan@example.com>, "Os Wi" <oswi@example.com>'''
    addrs = address.parse_list(s)
 
    assert_equal(2, len(addrs))
 
    s = u'''I am also A <a@HOST.com>, Zeka <EV@host.coM> ;Gonzalo BaƱuelos<gonz@host.com>'''
    addrs = address.parse_list(s)
 
    assert_equal(3, len(addrs))

src/f/l/flanker-HEAD/tests/addresslib/parser_address_list_test.py   flanker(Download)
def run_relaxed_test(string, expected_mlist, expected_unpar):
    mlist, unpar = address.parse_list(string, strict=False, as_tuple=True)
    assert_equal(mlist, expected_mlist)
    assert_equal(unpar, expected_unpar)
 
@nottest
def run_strict_test(string, expected_mlist):
    mlist = address.parse_list(string, strict=True)
def test_simple_valid():
    s = '''http://foo.com:8080; "Ev K." <ev@host.com>, "Alex K" alex@yahoo.net, "Tom, S" "tom+[a]"@s.com'''
    addrs = address.parse_list(s)
 
    assert_equal(4, len(addrs))
 
    s = '''"Allan G\'o"  <allan@example.com>, "Os Wi" <oswi@example.com>'''
    addrs = address.parse_list(s)
 
    assert_equal(2, len(addrs))
 
    s = u'''I am also A <a@HOST.com>, Zeka <EV@host.coM> ;Gonzalo BaƱuelos<gonz@host.com>'''
    addrs = address.parse_list(s)
 
    assert_equal(3, len(addrs))

src/i/n/inbox-HEAD/src/inbox/server/sendmail/message.py   inbox(Download)
    full_name = sender_info.name if sender_info.name else ''
    email_address = sender_info.email
    to = address.parse_list(recipients.to)
    cc = address.parse_list(recipients.cc)
    bcc = address.parse_list(recipients.bcc)

src/f/l/flanker-0.4.14/flanker/mime/message/headers/encoding.py   flanker(Download)
def encode_address_header(name, value):
    out = deque()
    for addr in flanker.addresslib.address.parse_list(value):
        out.append(addr.full_spec())
    return "; ".join(out)

src/f/l/flanker-HEAD/flanker/mime/message/headers/encoding.py   flanker(Download)
def encode_address_header(name, value):
    out = deque()
    for addr in flanker.addresslib.address.parse_list(value):
        out.append(addr.full_spec())
    return "; ".join(out)

src/i/n/inbox-HEAD/src/inbox/server/sendmail/gmail/message.py   inbox(Download)
             msg.headers.get('Bcc') if m])
 
    recipients = [a.full_spec() for a in address.parse_list(all_recipients)]
 
    # Keep Cc-, but strip Bcc-

src/i/n/inbox-HEAD/src/inbox/util/addr.py   inbox(Download)
def parse_email_address_list(email_addresses):
    parsed = address.parse_list(email_addresses)
    return [or_none(addr, lambda p:
            (strip_quotes(p.display_name), p.address)) for addr in parsed]
 

src/f/l/flanker-0.4.14/tests/addresslib/metrics_test.py   flanker(Download)
def test_metrics_parse_list():
    # parse_list
    assert_equal(len(address.parse_list('foo@example.com, bar@example.com', metrics=True)), 2)
    p, m = address.parse_list('foo@example.com, bar@example.com', metrics=True)
    assert_equal('parsing' in m, True)
    assert_equal(isinstance(address.parse_list('foo@example.com, bar@example.com', metrics=False), address.AddressList), True)
    assert_equal(isinstance(address.parse_list('foo@example.com, bar@example.com'), address.AddressList), True)

src/f/l/flanker-HEAD/tests/addresslib/metrics_test.py   flanker(Download)
def test_metrics_parse_list():
    # parse_list
    assert_equal(len(address.parse_list('foo@example.com, bar@example.com', metrics=True)), 2)
    p, m = address.parse_list('foo@example.com, bar@example.com', metrics=True)
    assert_equal('parsing' in m, True)
    assert_equal(isinstance(address.parse_list('foo@example.com, bar@example.com', metrics=False), address.AddressList), True)
    assert_equal(isinstance(address.parse_list('foo@example.com, bar@example.com'), address.AddressList), True)

src/f/l/flanker-0.4.14/tests/addresslib/address_test.py   flanker(Download)
from nose.tools import assert_equal, assert_not_equal
 
from flanker.addresslib.address import parse, parse_list
from flanker.addresslib.address import Address, AddressList, EmailAddress, UrlAddress
 
def test_addresslist_basics():
    lst = parse_list("http://foo.com:1000; Biz@Kontsevoy.Com   ")
    eq_ (2, len(lst))
    eq_ ("http", lst[0].scheme)
    eq_ ("kontsevoy.com", lst[1].hostname)
    # check parsing:
    spec = '''http://foo.com:8080, "Ev K." <ev@host.com>, "Alex K" alex@yahoo.net; "Tom, S" "tom+[a]"@s.com'''
    lst = parse_list(spec, True)
 
    eq_ (len(lst), 4)
    # string-based persistence:
    s = str(lst)
    clone = parse_list(s)
    eq_ (lst, clone)
 
    # now clone using full spec:
    s = lst.full_spec()
    clone = parse_list(s)

  1 | 2  Next