def test_mulitple_on(self): reply = read(get_fixture("greedy_on")) self.assert_regex(str(reply.fragments[0]), r"^On your remote host") self.assert_regex(str(reply.fragments[1]), r"^On 9 Jan 2014") self.assertEqual([False, True, False], l_quoted(reply.fragments)) self.assertEqual([False, False, False], l_signature(reply.fragments)) self.assertEqual([False, True, True], l_hidden(reply.fragments))
def test_reads_email_with_correct_signature(self): reply = read(get_fixture('correct_sig')) self.assertEqual(2, len(reply.fragments)) self.assertEqual([False, False], l_quoted(reply.fragments)) self.assertEqual([False, True], l_signature(reply.fragments)) self.assertEqual([False, True], l_hidden(reply.fragments)) self.assert_regex(str(reply.fragments[1]), r"^-- \nrick")
def test_doesnt_remove_signature_delimiter_in_mid_line(self): reply = read(get_fixture("email_sig_delimiter_in_middle_of_line")) self.assertEqual(1, len(reply.fragments))
def test_parse_reply(self): body = get_fixture("email_1_2") self.assertEqual(read(body).visible_text(), parse_reply(body))
def email(name): return read(get_fixture('email_{}'.format(name)))