示例#1
0
def test_other_header():
    actual = get_email_details(OTHER_HEADER)
    expected = {'from': 'Bob & Julian from PyBites ([email protected])',
                'to': '*****@*****.**',
                'subject': 'New regex learning path!',
                'date': 'Sun, 18 Aug 2019 17:16:10'}
    assert actual == expected
示例#2
0
def test_given_header():
    actual = get_email_details(EMAIL_HEADER)
    expected = {'from': 'redacted-address',
                'to': 'redacted-address',
                'subject': 'A Test From SendGrid',
                'date': 'Wed, 19 Jun 2013 17:09:33'}
    assert actual == expected
示例#3
0
def test_other_header():
    actual = get_email_details(OTHER_HEADER)
    expected = {
        "from": "Bob & Julian from PyBites ([email protected])",
        "to": "*****@*****.**",
        "subject": "New regex learning path!",
        "date": "Sun, 18 Aug 2019 17:16:10",
    }
    assert actual == expected
示例#4
0
def test_given_header():
    actual = get_email_details(EMAIL_HEADER)
    expected = {
        "from": "redacted-address",
        "to": "redacted-address",
        "subject": "A Test From SendGrid",
        "date": "Wed, 19 Jun 2013 17:09:33",
    }
    assert actual == expected
def test_no_match():
    assert get_email_details('bogus') is None