gentests: allow test-specific FileDownloader params override from tests.json
authorFilippo Valsorda <filippo.valsorda@gmail.com>
Tue, 11 Dec 2012 11:09:22 +0000 (12:09 +0100)
committerFilippo Valsorda <filippo.valsorda@gmail.com>
Tue, 11 Dec 2012 11:09:22 +0000 (12:09 +0100)
test/gentests.py

index a20b139f5dce282353698aff3d70f996a1fbf5f6..ee9092f33eb9d62fb8e692564e8c1ac149a4700d 100755 (executable)
@@ -104,7 +104,10 @@ def gentests():
                 write('@_skip(' + repr(d['skip']) + ')')
             write('def test_' + name + '(self):')
             write('    filename = ' + repr(d['file']))
-            write('    fd = FileDownloader(self.parameters)')
+            write('    params = self.parameters')
+            for p in d.get('params', {}):
+                write('    params["' + p + '"] = ' + repr(d['params'][p]))
+            write('    fd = FileDownloader(params)')
             write('    fd.add_info_extractor(youtube_dl.InfoExtractors.' + name + 'IE())')
             for ien in d.get('addIEs', []):
                 write('    fd.add_info_extractor(youtube_dl.InfoExtractors.' + ien + 'IE())')