Skip to content

Commit 5b26332

Browse files
committed
Make the infer audio content subtypes test more robust
1 parent 15cd8ad commit 5b26332

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

Lib/test/test_email/test_email.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1567,11 +1567,16 @@ def test_infer_audio_content_subtypes(self):
15671567
data_to_subtype = {
15681568
b'FORM AIFC' : 'x-aiff',
15691569
b'FORM AIFF' : 'x-aiff',
1570+
b'RIFF WAVEfmt ': 'x-wav',
15701571
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-
}
15741572

1573+
# Check that the 4 intermediate chars have no effect
1574+
b'FORMabcdAIFC' : 'x-aiff',
1575+
b'FORMzyxwAIFF' : 'x-aiff',
1576+
b'RIFF1234WAVEfmt ': 'x-wav',
1577+
# Check that anything after the first 4 chars has no effect
1578+
b'.sndFOOBARZ' : 'basic',
1579+
}
15751580
for audiodata, subtype in data_to_subtype.items():
15761581
au = MIMEAudio(audiodata)
15771582
self.assertEqual(au.get_content_subtype(), subtype)

0 commit comments

Comments
 (0)