From 072a4408379eb42c59cededdb6f8a1ceafd05fc0 Mon Sep 17 00:00:00 2001 From: Simon Date: Wed, 15 Apr 2015 13:55:17 +0200 Subject: [PATCH] Test cases for new patterns --- tests/text_quotations_test.py | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/tests/text_quotations_test.py b/tests/text_quotations_test.py index b68b132..918ed29 100644 --- a/tests/text_quotations_test.py +++ b/tests/text_quotations_test.py @@ -33,6 +33,16 @@ On 11-Apr-2011, at 6:54 PM, Roman Tkachenko wrote: eq_("Test reply", quotations.extract_from_plain(msg_body)) +def test_pattern_on_date_wrote_somebody(): + eq_('Lorem', quotations.extract_from_plain( + """Lorem + +Op 13-02-2014 3:18 schreef Julius Caesar : + +Veniam laborum mlkshk kale chips authentic. Normcore mumblecore laboris, fanny pack readymade eu blog chia pop-up freegan enim master cleanse. +""")) + + def test_pattern_on_date_somebody_wrote_date_with_slashes(): msg_body = """Test reply @@ -201,6 +211,15 @@ On 04/19/2011 07:10 AM, Roman Tkachenko wrote: > Hello""" eq_("Hi", quotations.extract_from_plain(msg_body)) +def test_with_indent(): + msg_body = """YOLO salvia cillum kogi typewriter mumblecore cardigan skateboard Austin. + +------On 12/29/1987 17:32 PM, Julius Caesar wrote----- + +Brunch mumblecore pug Marfa tofu, irure taxidermy hoodie readymade pariatur. + """ + eq_("YOLO salvia cillum kogi typewriter mumblecore cardigan skateboard Austin.", quotations.extract_from_plain(msg_body)) + def test_short_quotation_with_newline(): msg_body = """Btw blah blah... @@ -293,6 +312,15 @@ Emne: The manager has commented on your Loop Blah-blah-blah """)) +def test_dutch_from_block(): + eq_('Gluten-free culpa lo-fi et nesciunt nostrud.', quotations.extract_from_plain( + """Gluten-free culpa lo-fi et nesciunt nostrud. + +Op 17-feb.-2015, om 13:18 heeft Julius Caesar het volgende geschreven: + +Small batch beard laboris tempor, non listicle hella Tumblr heirloom. +""")) + def test_quotation_marker_false_positive(): msg_body = """Visit us now for assistance...