Пример #1
0
def test_split_email():
    msg = """From: Mr. X
    Date: 24 February 2016
    To: Mr. Y
    Subject: Hi
    Attachments: none
    Goodbye.
    From: Mr. Y
    To: Mr. X
    Date: 24 February 2016
    Subject: Hi
    Attachments: none

    Hello.

        On 24th February 2016 at 09.32am, Conal wrote:

        Hey!

        On Mon, 2016-10-03 at 09:45 -0600, Stangel, Dan wrote:
        > Mohan,
        >
        > We have not yet migrated the systems.
        >
        > Dan
        >
        > > -----Original Message-----
        > > Date: Mon, 2 Apr 2012 17:44:22 +0400
        > > Subject: Test
        > > From: [email protected]
        > > To: [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]
        > >
        > > Hi
        > >
        > > > From: [email protected]
        > > > To: [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]
        > > > Date: Mon, 2 Apr 2012 17:44:22 +0400
        > > > Subject: Test
        > > > Hi
        > > >
        > >
        >
        >
"""
    expected_markers = "stttttsttttetesetesmmmmmmssmmmmmmsmmmmmmmm"
    markers = quotations.split_emails(msg)
    eq_(markers, expected_markers)
Пример #2
0
def test_split_email():
    msg = """From: Mr. X
    Date: 24 February 2016
    To: Mr. Y
    Subject: Hi
    Attachments: none
    Goodbye.
    From: Mr. Y
    To: Mr. X
    Date: 24 February 2016
    Subject: Hi
    Attachments: none

    Hello.

        On 24th February 2016 at 09.32am, Conal wrote:

        Hey!

        On Mon, 2016-10-03 at 09:45 -0600, Stangel, Dan wrote:
        > Mohan,
        >
        > We have not yet migrated the systems.
        >
        > Dan
        >
        > > -----Original Message-----
        > > Date: Mon, 2 Apr 2012 17:44:22 +0400
        > > Subject: Test
        > > From: [email protected]
        > > To: [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]
        > >
        > > Hi
        > >
        > > > From: [email protected]
        > > > To: [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]
        > > > Date: Mon, 2 Apr 2012 17:44:22 +0400
        > > > Subject: Test
        > > > Hi
        > > >
        > >
        >
        >
"""
    expected_markers = "stttttsttttetesetesmmmmmmsmmmmmmmmmmmmmmmm"
    markers = quotations.split_emails(msg)
    eq_(markers, expected_markers)
Пример #3
0
def test_split_email():
    msg = """From: Mr. X
Date: 24 February 2016
To: Mr. Y
Subject: Hi
Attachments: none
Goodbye.
From: Mr. Y
To: Mr. X
Date: 24 February 2016
Subject: Hi
Attachments: none

Hello.

-- Original Message --
On 24th February 2016 at 09.32am Conal Wrote:
Hey!
"""
    expected_markers = "stttttsttttetestt"
    markers = quotations.split_emails(msg)
    eq_(markers, expected_markers)
def splitEmail(message):
    return quotations.split_emails(message)