Skip to content

Commit 41d4e89

Browse files
committed
Replace with more useful test case
1 parent cbc5421 commit 41d4e89

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

Lib/test/test_mimetypes.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -307,8 +307,13 @@ def test_keywords_args_api(self):
307307
type='image/jpg', strict=False), '.jpg')
308308

309309
def test_added_types_are_used(self):
310+
mimetypes.add_type('testing/default-type', '')
311+
mime_type, _ = mimetypes.guess_type('')
312+
self.assertEqual(mime_type, 'testing/default-type')
313+
310314
mime_type, _ = mimetypes.guess_type('test.myext')
311315
self.assertEqual(mime_type, None)
316+
312317
mimetypes.add_type('testing/type', '.myext')
313318
mime_type, _ = mimetypes.guess_type('test.myext')
314319
self.assertEqual(mime_type, 'testing/type')
@@ -319,11 +324,6 @@ def test_add_type_with_undotted_extension_raises_exception(self):
319324
):
320325
mimetypes.add_type('testing/type', 'undotted')
321326

322-
def test_add_type_with_empty_extension_emits_no_warning(self):
323-
with warnings.catch_warnings(record=True) as wlog:
324-
mimetypes.add_type('testing/type', '')
325-
self.assertEqual(len(wlog), 0)
326-
327327

328328
@unittest.skipUnless(sys.platform.startswith("win"), "Windows only")
329329
class Win32MimeTypesTestCase(unittest.TestCase):

0 commit comments

Comments
 (0)