1
0
mirror of https://github.com/yt-dlp/yt-dlp.git synced 2025-07-17 02:38:30 +00:00

Update test_utils.py

Add test cases for legacy device sanitation.
This commit is contained in:
Alan Xiao 2025-04-23 19:36:28 -04:00 committed by GitHub
parent 968d8e3613
commit 49311c2db6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -249,6 +249,14 @@ def test_sanitize_path(self):
self.assertEqual(sanitize_path('abc.../def...'), 'abc..#\\def..#')
self.assertEqual(sanitize_path('C:\\abc:%(title)s.%(ext)s'), 'C:\\abc#%(title)s.%(ext)s')
self.assertEqual(sanitize_path('CON.opus'), 'CON_res.opus')
self.assertEqual(sanitize_path('abc\\CON\\def'), 'abc\\CON_res\\def')
self.assertEqual(sanitize_path('CON\\abc'), 'CON_res\\abc')
self.assertEqual(sanitize_path('CON.'), 'CON#')
self.assertEqual(sanitize_path('CON..'), 'CON_res.#')
self.assertEqual(sanitize_path('\\\\.\\CON'), '\\\\.\\CON')
self.assertEqual(sanitize_path('\\\\.\\CON\\abc'), '\\\\.\\CON_res\\abc')
# Check with nt._path_normpath if available
try:
from nt import _path_normpath as nt_path_normpath