diff options
author | Simon Sawicki <contact@grub4k.xyz> | 2025-03-22 00:41:56 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-03-21 23:41:56 +0000 |
commit | f36e4b6e65cb8403791aae2f520697115cb88dec (patch) | |
tree | c161d5f0a52648e0abca699a02cb9d6897deff45 /test/test_utils.py | |
parent | 983095485c731240aae27c950cb8c24a50827b56 (diff) |
[cleanup] Misc (#12526)
Authored by: Grub4K, seproDev, gamer191, dirkf
Co-authored-by: sepro <sepro@sepr0.com>
Diffstat (limited to 'test/test_utils.py')
-rw-r--r-- | test/test_utils.py | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/test/test_utils.py b/test/test_utils.py index 65f28db36..42dc7f937 100644 --- a/test/test_utils.py +++ b/test/test_utils.py @@ -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 [ |