test_typed_subpart_iterator_default_type(): Test for when the message

has no Content-Type: header, it should be treated as text/plain.
This commit is contained in:
Barry Warsaw 2001-10-15 04:39:02 +00:00
parent 0164b6bf22
commit cdc632cfdb

View file

@ -886,6 +886,24 @@ def test_typed_subpart_iterator(self):
to reflect upon our own
""")
def test_typed_subpart_iterator_default_type(self):
eq = self.assertEqual
msg = self._msgobj('msg_03.txt')
it = Iterators.typed_subpart_iterator(msg, 'text', 'plain')
lines = []
subparts = 0
for subpart in it:
subparts += 1
lines.append(subpart.get_payload())
eq(subparts, 1)
eq(EMPTYSTRING.join(lines), """\
Hi,
Do you like this message?
-Me
""")
class TestParsers(unittest.TestCase):