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

All Samples(34)  |  Call(32)  |  Derive(0)  |  Import(2)

src/i/n/inbox-HEAD/src/inbox/server/contacts/process_mail.py   inbox(Download)
def canonicalize_address(addr):
    """Gmail addresses with and without periods are the same, so we want to
    treat them as belonging to the same contact."""
    parsed_address = address.parse(addr, addr_spec_only=True)
    local_part = parsed_address.mailbox

src/i/n/inbox-HEAD/src/inbox/server/sendmail/message.py   inbox(Download)
    # For other providers, we simply use full_name = ''
    from_addr = u'"{0}" <{1}>'.format(full_name, email_address)
    from_addr = address.parse(from_addr)
    msg.headers['From'] = from_addr.full_spec()
 

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

src/f/l/flanker-HEAD/tests/addresslib/metrics_test.py   flanker(Download)
def test_metrics_parse():
    # parse
    assert_equal(len(address.parse('foo@example.com', metrics=True)), 2)
    p, m = address.parse('foo@example.com', metrics=True)
    assert_equal('parsing' in m, True)
    assert_equal(isinstance(address.parse('foo@example.com', metrics=False), address.EmailAddress), True)
    assert_equal(isinstance(address.parse('foo@example.com'), address.EmailAddress), 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_addr_properties():
    email = parse('name@host.com')
    url = parse('http://host.com')
    non_ascii = parse(u'Gonzalo BaƱuelos<gonz@host.com>')
    eq_(non_ascii, "gonz@host.com")
 
    adr = parse("Zeka <EV@host.coM>")
    eq_ (str(adr), 'EV@host.com')
 

src/f/l/flanker-HEAD/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_addr_properties():
    email = parse('name@host.com')
    url = parse('http://host.com')
    non_ascii = parse(u'Gonzalo BaƱuelos<gonz@host.com>')
    eq_(non_ascii, "gonz@host.com")
 
    adr = parse("Zeka <EV@host.coM>")
    eq_ (str(adr), 'EV@host.com')
 

src/f/l/flanker-0.4.14/tests/addresslib/parser_mailbox_test.py   flanker(Download)
def run_full_mailbox_test(string, expected, full_spec=None):
    mbox = address.parse(string)
    if mbox:
        assert_equal(mbox.display_name, expected.display_name)
        assert_equal(mbox.address, expected.address)
def run_mailbox_test(string, expected_string):
    mbox = address.parse(string)
    if mbox:
        assert_equal(mbox.address, expected_string)
        return
    # Given
    original = 'very loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong <foo@example.com>'
    addr = address.parse(original)
 
    # When

src/f/l/flanker-HEAD/tests/addresslib/parser_mailbox_test.py   flanker(Download)
def run_full_mailbox_test(string, expected, full_spec=None):
    mbox = address.parse(string)
    if mbox:
        assert_equal(mbox.display_name, expected.display_name)
        assert_equal(mbox.address, expected.address)
def run_mailbox_test(string, expected_string):
    mbox = address.parse(string)
    if mbox:
        assert_equal(mbox.address, expected_string)
        return
    # Given
    original = 'very loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong <foo@example.com>'
    addr = address.parse(original)
 
    # When

src/f/l/flanker-0.4.14/tests/addresslib/external_dataset_test.py   flanker(Download)
            continue
 
        mbox = address.parse(line)
        assert_not_equal(mbox, None)
 
            continue
 
        mbox = address.parse(line)
        assert_equal(mbox, None)
 
            continue
 
        mbox = address.parse(line)
        assert_not_equal(mbox, None)
 
            continue
 
        mbox = address.parse(line)
        assert_equal(mbox, None)
 

src/f/l/flanker-HEAD/tests/addresslib/external_dataset_test.py   flanker(Download)
            continue
 
        mbox = address.parse(line)
        assert_not_equal(mbox, None)
 
            continue
 
        mbox = address.parse(line)
        assert_equal(mbox, None)
 
            continue
 
        mbox = address.parse(line)
        assert_not_equal(mbox, None)
 
            continue
 
        mbox = address.parse(line)
        assert_equal(mbox, None)