- 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 youtube_dlc.compat
- all_names = youtube_dlc.compat.__all__
- present_names = set(filter(
- lambda c: '_' in c and not c.startswith('_'),
- dir(youtube_dlc.compat))) - set(['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 ''