|
|
a3483f9 |
--- Python-3.1.1/Lib/email/test/test_email.py.remove_mimeaudio_tests 2009-10-27 14:31:09.483539561 -0400
|
|
|
a3483f9 |
+++ Python-3.1.1/Lib/email/test/test_email.py 2009-10-27 14:31:27.663548053 -0400
|
|
|
a3483f9 |
@@ -926,52 +926,6 @@ Blah blah blah
|
|
|
a3483f9 |
|
|
|
a3483f9 |
|
|
|
a3483f9 |
|
|
|
a3483f9 |
-# Test the basic MIMEAudio class
|
|
|
a3483f9 |
-class TestMIMEAudio(unittest.TestCase):
|
|
|
a3483f9 |
- def setUp(self):
|
|
|
a3483f9 |
- # Make sure we pick up the audiotest.au that lives in email/test/data.
|
|
|
a3483f9 |
- # In Python, there's an audiotest.au living in Lib/test but that isn't
|
|
|
a3483f9 |
- # included in some binary distros that don't include the test
|
|
|
a3483f9 |
- # package. The trailing empty string on the .join() is significant
|
|
|
a3483f9 |
- # since findfile() will do a dirname().
|
|
|
a3483f9 |
- datadir = os.path.join(os.path.dirname(landmark), 'data', '')
|
|
|
a3483f9 |
- with open(findfile('audiotest.au', datadir), 'rb') as fp:
|
|
|
a3483f9 |
- self._audiodata = fp.read()
|
|
|
a3483f9 |
- self._au = MIMEAudio(self._audiodata)
|
|
|
a3483f9 |
-
|
|
|
a3483f9 |
- def test_guess_minor_type(self):
|
|
|
a3483f9 |
- self.assertEqual(self._au.get_content_type(), 'audio/basic')
|
|
|
a3483f9 |
-
|
|
|
a3483f9 |
- def test_encoding(self):
|
|
|
a3483f9 |
- payload = self._au.get_payload()
|
|
|
a3483f9 |
- self.assertEqual(base64.decodebytes(payload), self._audiodata)
|
|
|
a3483f9 |
-
|
|
|
a3483f9 |
- def test_checkSetMinor(self):
|
|
|
a3483f9 |
- au = MIMEAudio(self._audiodata, 'fish')
|
|
|
a3483f9 |
- self.assertEqual(au.get_content_type(), 'audio/fish')
|
|
|
a3483f9 |
-
|
|
|
a3483f9 |
- def test_add_header(self):
|
|
|
a3483f9 |
- eq = self.assertEqual
|
|
|
a3483f9 |
- unless = self.assertTrue
|
|
|
a3483f9 |
- self._au.add_header('Content-Disposition', 'attachment',
|
|
|
a3483f9 |
- filename='audiotest.au')
|
|
|
a3483f9 |
- eq(self._au['content-disposition'],
|
|
|
a3483f9 |
- 'attachment; filename="audiotest.au"')
|
|
|
a3483f9 |
- eq(self._au.get_params(header='content-disposition'),
|
|
|
a3483f9 |
- [('attachment', ''), ('filename', 'audiotest.au')])
|
|
|
a3483f9 |
- eq(self._au.get_param('filename', header='content-disposition'),
|
|
|
a3483f9 |
- 'audiotest.au')
|
|
|
a3483f9 |
- missing = []
|
|
|
a3483f9 |
- eq(self._au.get_param('attachment', header='content-disposition'), '')
|
|
|
a3483f9 |
- unless(self._au.get_param('foo', failobj=missing,
|
|
|
a3483f9 |
- header='content-disposition') is missing)
|
|
|
a3483f9 |
- # Try some missing stuff
|
|
|
a3483f9 |
- unless(self._au.get_param('foobar', missing) is missing)
|
|
|
a3483f9 |
- unless(self._au.get_param('attachment', missing,
|
|
|
a3483f9 |
- header='foobar') is missing)
|
|
|
a3483f9 |
-
|
|
|
a3483f9 |
-
|
|
|
a3483f9 |
-
|
|
|
a3483f9 |
# Test the basic MIMEImage class
|
|
|
a3483f9 |
class TestMIMEImage(unittest.TestCase):
|
|
|
a3483f9 |
def setUp(self):
|