Skip to content

Commit b43eaa6

Browse files
committed
bpo-38449: Add tricky test cases
1 parent 19a3d87 commit b43eaa6

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Lib/test/test_mimetypes.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,12 @@ def test_non_standard_types(self):
5151
eq(self.db.guess_type('foo.xul', strict=False), ('text/xul', None))
5252
eq(self.db.guess_extension('image/jpg', strict=False), '.jpg')
5353

54+
def test_tricky_cases(self):
55+
# bpo-38449: Tricky cases should be handled also.
56+
eq = self.assertEqual
57+
eq(self.db.guess_type(";1.tar.gz"), ('application/x-tar', 'gzip'))
58+
eq(self.db.guess_type(r" \"\`;b&b&c |.tar.gz"), ('application/x-tar', 'gzip'))
59+
5460
def test_guess_all_types(self):
5561
eq = self.assertEqual
5662
unless = self.assertTrue

0 commit comments

Comments
 (0)