MCPcopy Index your code
hub / github.com/python/cpython / test_is_attachment

Method test_is_attachment

Lib/test/test_email/test_message.py:729–739  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

727 self.assertEqual(list(m.iter_parts()), [])
728
729 def test_is_attachment(self):
730 m = self._make_message()
731 self.assertFalse(m.is_attachment())
732 m['Content-Disposition'] = 'inline'
733 self.assertFalse(m.is_attachment())
734 m.replace_header('Content-Disposition', 'attachment')
735 self.assertTrue(m.is_attachment())
736 m.replace_header('Content-Disposition', 'AtTachMent')
737 self.assertTrue(m.is_attachment())
738 m.set_param('filename', 'abc.png', 'Content-Disposition')
739 self.assertTrue(m.is_attachment())
740
741 def test_iter_attachments_mutation(self):
742 # We had a bug where iter_attachments was mutating the list.

Callers

nothing calls this directly

Calls 6

_make_messageMethod · 0.80
assertFalseMethod · 0.80
is_attachmentMethod · 0.80
replace_headerMethod · 0.80
assertTrueMethod · 0.80
set_paramMethod · 0.80

Tested by

no test coverage detected