diff options
author | Philipp Hagemeister <phihag@phihag.de> | 2013-06-27 21:15:16 +0200 |
---|---|---|
committer | Philipp Hagemeister <phihag@phihag.de> | 2013-06-27 21:15:16 +0200 |
commit | fc2c063e1eeb47b39899d687da56f0daddcbb027 (patch) | |
tree | 2d56910a4ab8d7fbc34828e5b7e0f4d4695a9701 /test/helper.py | |
parent | 20db33e29913c92d67907a939b335c00ebc03940 (diff) |
Move testcase generator to helper
Diffstat (limited to 'test/helper.py')
-rw-r--r-- | test/helper.py | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/test/helper.py b/test/helper.py index 842ffc2fd..a2b468b50 100644 --- a/test/helper.py +++ b/test/helper.py @@ -2,6 +2,7 @@ import io import json import os.path +import youtube_dl.extractor from youtube_dl import YoutubeDL, YoutubeDLHandler from youtube_dl.utils import ( compat_cookiejar, @@ -30,4 +31,14 @@ class FakeYDL(YoutubeDL): def trouble(self, s, tb=None): raise Exception(s) def download(self, x): - self.result.append(x)
\ No newline at end of file + self.result.append(x) + +def get_testcases(): + for ie in youtube_dl.extractor.gen_extractors(): + t = getattr(ie, '_TEST', None) + if t: + t['name'] = type(ie).__name__[:-len('IE')] + yield t + for t in getattr(ie, '_TESTS', []): + t['name'] = type(ie).__name__[:-len('IE')] + yield t |