jakul/email-reply-parser — pull request #4 by anamcerqueira (2014-10-31 17:30:10+00:00)
Title: Remove signature

(nlmanagement)liona:email-reply-parser anacerqueira$ python setup.py test
running test
running egg_info
writing email_reply_parser.egg-info/PKG-INFO
writing top-level names to email_reply_parser.egg-info/top_level.txt
writing dependency_links to email_reply_parser.egg-info/dependency_links.txt
reading manifest file 'email_reply_parser.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no files found matching 'VERSION'
writing manifest file 'email_reply_parser.egg-info/SOURCES.txt'
running build_ext
test_captures_date_string (test.test_email_reply_parser.EmailMessageTest) ... ok
test_complex_body_with_one_fragment (test.test_email_reply_parser.EmailMessageTest) ... ok
test_deals_with_windows_line_endings (test.test_email_reply_parser.EmailMessageTest) ... ok
test_email_one_is_not_on (test.test_email_reply_parser.EmailMessageTest) ... ok
test_multiline_reply_headers (test.test_email_reply_parser.EmailMessageTest) ... ok
test_reads_bottom_message (test.test_email_reply_parser.EmailMessageTest) ... ok
test_reads_top_post (test.test_email_reply_parser.EmailMessageTest) ... ok
test_reply_is_parsed (test.test_email_reply_parser.EmailMessageTest) ... ok
test_sent_from_iphone (test.test_email_reply_parser.EmailMessageTest) ... ok
test_simple_body (test.test_email_reply_parser.EmailMessageTest) ... ok
test_verify_reads_signature_correct (test.test_email_reply_parser.EmailMessageTest) ... ok
test_Regards (test.test_email_reply_parser.NHSNETEmailMessageTest) ... ok
test_best_regards (test.test_email_reply_parser.NHSNETEmailMessageTest) ... ok
test_confidential (test.test_email_reply_parser.NHSNETEmailMessageTest) ... ok
test_email_disclaimer (test.test_email_reply_parser.NHSNETEmailMessageTest) ... ok
test_intended_recipients_only (test.test_email_reply_parser.NHSNETEmailMessageTest) ... ok
test_kind_regards (test.test_email_reply_parser.NHSNETEmailMessageTest) ... ok
test_many_thanks (test.test_email_reply_parser.NHSNETEmailMessageTest) ... ok
test_nhs_net_quoting (test.test_email_reply_parser.NHSNETEmailMessageTest) ... ok
test_nhs_net_quoting2 (test.test_email_reply_parser.NHSNETEmailMessageTest) ... ok
test_nhs_net_quoting3 (test.test_email_reply_parser.NHSNETEmailMessageTest) ... ok
test_nhs_net_quoting4 (test.test_email_reply_parser.NHSNETEmailMessageTest) ... ok
test_nhs_remove_signature (test.test_email_reply_parser.NHSNETEmailMessageTest) ... ok
test_nhs_remove_signature_2 (test.test_email_reply_parser.NHSNETEmailMessageTest) ... ok
test_nhs_remove_signature_3 (test.test_email_reply_parser.NHSNETEmailMessageTest) ... ok
test_regards (test.test_email_reply_parser.NHSNETEmailMessageTest) ... ok
test_regards_signature (test.test_email_reply_parser.NHSNETEmailMessageTest) ... ok
test_sent_from_samsung_mobile (test.test_email_reply_parser.NHSNETEmailMessageTest) ... ok
test_stars (test.test_email_reply_parser.NHSNETEmailMessageTest) ... ok
test_underscores (test.test_email_reply_parser.NHSNETEmailMessageTest) ... ok

----------------------------------------------------------------------
Ran 30 tests in 0.023s

OK

Task:
https://trello.com/c/EDjsLeJB/2608-remove-email-signature

>>> text = open('test/emails/email_nhs_net_7.txt').read()
>>> message = NHSNETEmailReplyParser.read(text)
>>> message.fragments[0].content
'Dear Dr Offodile, I completed all payments yesterday and cheques were sent in the post last night, I have no further outstanding invoices for you at present.\n\nKind regards.\n\n\n\n'
>>> message.fragments[1].content
'MS WENDY K ABRAHAM\n\nExecutive Admin Manager\n\nBellevue Medical Centre\n\n6 Bellevue\n\nEdgbaston\n\nBirmingham B5 7LX\n\nDirect Line: 0121 446 2001\n\nFax: 0121 446 2015\n\nEmail: wendy.abraham@nhs.net\n\n\n\nThis email contains proprietary information some or all of which may be legally privileged. It is for the intended recipient only. If an addressing or transmission error has misdirected this e-mail, please notify the author by replying to this email. If you are not the intended recipient you must not use, disclose, distribute, copy, print or rely on this email.\n'