Skip to content

Commit ac8e652

Browse files
committed
Add a test for inferring the audio content subtypes
1 parent 09cd7f1 commit ac8e652

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

Lib/test/test_email/test_email.py

+12
Original file line numberDiff line numberDiff line change
@@ -1563,6 +1563,18 @@ def test_add_header(self):
15631563
self.assertIs(self._au.get_param('attachment', missing,
15641564
header='foobar'), missing)
15651565

1566+
def test_infer_audio_content_subtypes(self):
1567+
data_to_subtype = {
1568+
b'FORM AIFC' : 'x-aiff',
1569+
b'FORM AIFF' : 'x-aiff',
1570+
b'.snd' : 'basic',
1571+
b'.snd1orem1ps' : 'basic', # the chars after '.snd' don't matter.
1572+
b'RIFF WAVEfmt ': 'x-wav', # trailing space is intentional.
1573+
}
1574+
1575+
for audiodata, subtype in data_to_subtype.items():
1576+
au = MIMEAudio(audiodata)
1577+
self.assertEqual(au.get_content_subtype(), subtype)
15661578

15671579

15681580
# Test the basic MIMEImage class

0 commit comments

Comments
 (0)