def test_raises_when_no_snippet(self): raw = dict(not_snippet='something else') with self.assertRaises(EmailValueNotPresent): extract_part_of_snippet('', '', raw)
def test_finds_heading_with_weekday(self): raw = dict(snippet="Here is the text before On Wed, Jul 5, 2018, at 10:51 AM and here is the text after") found = extract_part_of_snippet('', '', raw) expected = "Here is the text before " self.assertEqual(found, expected)
def test_both_headings_present2(self): raw = dict(snippet="Here is the text before On Apr 5, 2018, at here's some more On Wed, Apr 5, 2018") found = extract_part_of_snippet('', '', raw) expected = "Here is the text before " self.assertEqual(found, expected)
def test_gets_snippet(self): self.assertEqual('snippet', extract_part_of_snippet('', '', self.basic_raw))