- test_str = r'C:\Documents and Settings\тест\Application Data'
- compat_setenv('HOME', test_str)
- self.assertEqual(compat_expanduser('~'), test_str)
- compat_setenv('HOME', old_home or '')
-
- def test_all_present(self):
- import yt_dlp.compat
- all_names = yt_dlp.compat.__all__
- present_names = set(filter(
- lambda c: '_' in c and not c.startswith('_'),
- dir(yt_dlp.compat))) - {'unicode_literals'}
- self.assertEqual(all_names, sorted(present_names))
+ test_str = R'C:\Documents and Settings\тест\Application Data'
+ try:
+ os.environ['HOME'] = test_str
+ self.assertEqual(compat_expanduser('~'), test_str)
+ finally:
+ os.environ['HOME'] = old_home or ''