diff options
author | Sergey M․ <dstftw@gmail.com> | 2016-05-09 21:55:03 +0600 |
---|---|---|
committer | Sergey M․ <dstftw@gmail.com> | 2016-05-09 21:55:03 +0600 |
commit | fe40f9eef2483748ed83c9749f35220143d8cc9b (patch) | |
tree | e816c0816891d9b80bf8f9f462e978e6627284e9 /test | |
parent | 6104cc2985c36e996df1aae7cfcc686f3bae0b82 (diff) |
[compat] Add compat_setenv
Diffstat (limited to 'test')
-rw-r--r-- | test/test_compat.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/test/test_compat.py b/test/test_compat.py index 618668210..0d751a856 100644 --- a/test/test_compat.py +++ b/test/test_compat.py @@ -13,6 +13,7 @@ sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) from youtube_dl.utils import get_filesystem_encoding from youtube_dl.compat import ( compat_getenv, + compat_setenv, compat_etree_fromstring, compat_expanduser, compat_shlex_split, @@ -31,6 +32,13 @@ class TestCompat(unittest.TestCase): else test_str.encode(get_filesystem_encoding())) self.assertEqual(compat_getenv('YOUTUBE-DL-TEST'), test_str) + def test_compat_setenv(self): + test_var = 'YOUTUBE-DL-TEST' + test_str = 'тест' + compat_setenv(test_var, test_str) + compat_getenv(test_var) + self.assertEqual(compat_getenv(test_var), test_str) + def test_compat_expanduser(self): old_home = os.environ.get('HOME') test_str = 'C:\Documents and Settings\тест\Application Data' |