From 5ebbe780fed8525ac15e7da74ea0569cae528997 Mon Sep 17 00:00:00 2001 From: Yen Chi Hsuan Date: Sun, 17 Jan 2016 16:53:44 +0800 Subject: [PATCH] [test_i18n] Add a test case for zipped app --- test/test_i18n.py | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/test/test_i18n.py b/test/test_i18n.py index a5b5bd988..e837bcf43 100644 --- a/test/test_i18n.py +++ b/test/test_i18n.py @@ -23,11 +23,13 @@ from youtube_dl.version import __version__ from youtube_dl.compat import subprocess_check_output from youtube_dl.utils import decodeFilename +rootDir_u = decodeFilename(rootDir) + @contextlib.contextmanager def chdir_to(path): oldpwd = os.getcwd() - os.chdir(os.path.join(decodeFilename(rootDir), path)) + os.chdir(os.path.join(rootDir_u, path)) yield os.chdir(oldpwd) @@ -107,5 +109,18 @@ class TestDirectInstall(I18NTestCase, unittest.TestCase): subprocess.check_call(['pip', 'uninstall', '--yes', 'youtube_dl']) +class TestZippedApp(I18NTestCase, unittest.TestCase): + PROGRAM = os.path.join(rootDir_u, 'youtube-dl') + + @classmethod + def install(cls): + with chdir_to('.'): + cls.make('youtube-dl') + + @classmethod + def uninstall(cls): + with chdir_to('.'): + os.unlink('youtube-dl') + if __name__ == '__main__': unittest.main()