def main(): fileplugin.init() for _, __, plugin in fileplugin.manager.plugins: if plugin.name == "checksum": break assert plugin.name == "checksum" tests = [FakeSHA1File(), FakeCRC32File(), FakeRIPEMD160File()] for t in tests: print "testing", t.hash_type path, file = fileplugin.fileorpath(t) assert plugin.match(path, file) fileplugin.manager.execute_plugin(plugin, path, file) assert not t.fatal_called print "\tok"
You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. """ from . import loader loader.init() import os import gevent from client import event, core, fileplugin, debugtools, download, torrent from client.scheme import transaction from client import interface fileplugin.init() rootpath = os.path.dirname(__file__) class FakeHosterPlugin(object): name = 'fake.com' def weight(self, file): return 100 def get_hostname(self, file): return 'fake.com' def _test_file(name, plugin):