diff options
author | RaNaN <Mast3rRaNaN@hotmail.de> | 2012-01-15 15:55:19 +0100 |
---|---|---|
committer | RaNaN <Mast3rRaNaN@hotmail.de> | 2012-01-15 15:55:19 +0100 |
commit | 26227cfe53f8fd4bc1631d8e1b35031f589682dc (patch) | |
tree | d468ab14d8179c9a097c3d388ce29b8ab5747475 /tests/CrypterPluginTester.py | |
parent | plugin tester links (diff) | |
download | pyload-26227cfe53f8fd4bc1631d8e1b35031f589682dc.tar.xz |
backend + api test case, nicer format for plugin tester
Diffstat (limited to 'tests/CrypterPluginTester.py')
-rw-r--r-- | tests/CrypterPluginTester.py | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/tests/CrypterPluginTester.py b/tests/CrypterPluginTester.py index 27013ede7..ceb58adc5 100644 --- a/tests/CrypterPluginTester.py +++ b/tests/CrypterPluginTester.py @@ -12,10 +12,10 @@ from module.plugins.Base import Fail from module.utils import accumulate, to_int class CrypterPluginTester(PluginTester): - @nottest def test_plugin(self, name, url, flag): + print "%s: %s" % (name, url) log(DEBUG, "%s: %s", name, url) plugin = self.core.pluginManager.getPluginClass(name) @@ -57,9 +57,15 @@ h, crypter = c.pluginManager.parseUrls(urls) plugins = accumulate(crypter) for plugin, urls in plugins.iteritems(): - for i, url in enumerate(urls): + def meta_class(plugin): + class _testerClass(CrypterPluginTester): + pass + _testerClass.__name__ = plugin + return _testerClass + _testerClass = meta_class(plugin) + for i, url in enumerate(urls): def meta(plugin, url, flag, sig): def _test(self): self.test_plugin(plugin, url, flag) @@ -67,5 +73,9 @@ for plugin, urls in plugins.iteritems(): _test.func_name = sig return _test - sig = "test_%s_LINK%d" % (plugin, i) - setattr(CrypterPluginTester, sig, meta(plugin, url, flags.get(url, None), sig))
\ No newline at end of file + sig = "test_LINK%d" % i + setattr(_testerClass, sig, meta(plugin, url, flags.get(url, None), sig)) + print url + + locals()[plugin] = _testerClass + del _testerClass
\ No newline at end of file |