mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2025-06-05 04:02:43 +02:00
[cleanup] Misc (#12526)
Authored by: Grub4K, seproDev, gamer191, dirkf Co-authored-by: sepro <sepro@sepr0.com>
This commit is contained in:
parent
983095485c
commit
f36e4b6e65
14 changed files with 37 additions and 42 deletions
|
@ -219,11 +219,8 @@ class TestUtil(unittest.TestCase):
|
|||
self.assertEqual(sanitize_filename('_BD_eEpuzXw', is_id=True), '_BD_eEpuzXw')
|
||||
self.assertEqual(sanitize_filename('N0Y__7-UOdI', is_id=True), 'N0Y__7-UOdI')
|
||||
|
||||
@unittest.mock.patch('sys.platform', 'win32')
|
||||
def test_sanitize_path(self):
|
||||
with unittest.mock.patch('sys.platform', 'win32'):
|
||||
self._test_sanitize_path()
|
||||
|
||||
def _test_sanitize_path(self):
|
||||
self.assertEqual(sanitize_path('abc'), 'abc')
|
||||
self.assertEqual(sanitize_path('abc/def'), 'abc\\def')
|
||||
self.assertEqual(sanitize_path('abc\\def'), 'abc\\def')
|
||||
|
@ -254,10 +251,8 @@ class TestUtil(unittest.TestCase):
|
|||
|
||||
# Check with nt._path_normpath if available
|
||||
try:
|
||||
import nt
|
||||
|
||||
nt_path_normpath = getattr(nt, '_path_normpath', None)
|
||||
except Exception:
|
||||
from nt import _path_normpath as nt_path_normpath
|
||||
except ImportError:
|
||||
nt_path_normpath = None
|
||||
|
||||
for test, expected in [
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue