def test_unit__append_follow(self):
     mail_parts = BodyMailParts()
     mail_parts.follow = True
     a = BodyMailPart("a", BodyMailPartType.Main)
     mail_parts._append(a)
     b = BodyMailPart("b", BodyMailPartType.Quote)
     mail_parts._append(b)
     assert len(mail_parts) == 1
     assert mail_parts[0].part_type == BodyMailPartType.Main
     assert mail_parts[0].text == "ab"
Example #2
0
 def test_unit__append_follow(self):
     mail_parts = BodyMailParts()
     mail_parts.follow = True
     a = BodyMailPart('a', BodyMailPartType.Main)
     mail_parts._append(a)
     b = BodyMailPart('b', BodyMailPartType.Quote)
     mail_parts._append(b)
     assert len(mail_parts) == 1
     assert mail_parts[0].part_type == BodyMailPartType.Main
     assert mail_parts[0].text == 'ab'
 def test_unit__drop_part_type_verify_no_follow_incidence(self):
     mail_parts = BodyMailParts()
     a = BodyMailPart("a", BodyMailPartType.Main)
     mail_parts._list.append(a)
     b = BodyMailPart("b", BodyMailPartType.Quote)
     mail_parts._list.append(b)
     c = BodyMailPart("c", BodyMailPartType.Signature)
     mail_parts._list.append(c)
     mail_parts.follow = True
     mail_parts.drop_part_type(BodyMailPartType.Quote)
     assert len(mail_parts) == 2
     assert mail_parts[0].text == "a"
     assert mail_parts[0].part_type == BodyMailPartType.Main
     assert len(mail_parts) == 2
     assert mail_parts[1].text == "c"
     assert mail_parts[1].part_type == BodyMailPartType.Signature
Example #4
0
 def test_unit__drop_part_type_verify_no_follow_incidence(self):
     mail_parts = BodyMailParts()
     a = BodyMailPart('a', BodyMailPartType.Main)
     mail_parts._list.append(a)
     b = BodyMailPart('b', BodyMailPartType.Quote)
     mail_parts._list.append(b)
     c = BodyMailPart('c', BodyMailPartType.Signature)
     mail_parts._list.append(c)
     mail_parts.follow = True
     mail_parts.drop_part_type(BodyMailPartType.Quote)
     assert len(mail_parts) == 2
     assert mail_parts[0].text == 'a'
     assert mail_parts[0].part_type == BodyMailPartType.Main
     assert len(mail_parts) == 2
     assert mail_parts[1].text == 'c'
     assert mail_parts[1].part_type == BodyMailPartType.Signature