def test_unit__append_dont_follow_when_first(self):
     mail_parts = BodyMailParts()
     a = BodyMailPart("a", BodyMailPartType.Main)
     mail_parts._append(a, follow=True)
     assert len(mail_parts) == 1
     assert mail_parts[0].part_type == BodyMailPartType.Main
     assert mail_parts[0].text == "a"
示例#2
0
 def test_unit__append_dont_follow_when_first(self):
     mail_parts = BodyMailParts()
     a = BodyMailPart('a', BodyMailPartType.Main)
     mail_parts._append(a, follow=True)
     assert len(mail_parts) == 1
     assert mail_parts[0].part_type == BodyMailPartType.Main
     assert mail_parts[0].text == 'a'
 def test_unit__append_different_type(self):
     mail_parts = BodyMailParts()
     a = BodyMailPart("a", BodyMailPartType.Main)
     mail_parts.append(a)
     b = BodyMailPart("b", BodyMailPartType.Quote)
     mail_parts._append(b)
     assert len(mail_parts) == 2
     assert mail_parts[0] == a
     assert mail_parts[1] == b
 def test_unit__append_same_type(self):
     mail_parts = BodyMailParts()
     a = BodyMailPart("a", BodyMailPartType.Main)
     mail_parts._append(a)
     b = BodyMailPart("b", BodyMailPartType.Main)
     mail_parts._append(b)
     assert len(mail_parts) == 1
     assert mail_parts[0].part_type == BodyMailPartType.Main
     assert mail_parts[0].text == "ab"
示例#5
0
 def test_unit__append_different_type(self):
     mail_parts = BodyMailParts()
     a = BodyMailPart('a', BodyMailPartType.Main)
     mail_parts.append(a)
     b = BodyMailPart('b', BodyMailPartType.Quote)
     mail_parts._append(b)
     assert len(mail_parts) == 2
     assert mail_parts[0] == a
     assert mail_parts[1] == b
示例#6
0
 def test_unit__append_same_type(self):
     mail_parts = BodyMailParts()
     a = BodyMailPart('a', BodyMailPartType.Main)
     mail_parts._append(a)
     b = BodyMailPart('b', BodyMailPartType.Main)
     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__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"
示例#8
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'