From 94c1cceae1e58c0b7cff09bef684751978d878e3 Mon Sep 17 00:00:00 2001 From: RaNaN Date: Sat, 11 Jan 2014 22:23:20 +0100 Subject: small cleanup, fixed some test cases --- tests/manager/test_downloadManager.py | 42 +++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 tests/manager/test_downloadManager.py (limited to 'tests/manager/test_downloadManager.py') diff --git a/tests/manager/test_downloadManager.py b/tests/manager/test_downloadManager.py new file mode 100644 index 000000000..9906ca1a0 --- /dev/null +++ b/tests/manager/test_downloadManager.py @@ -0,0 +1,42 @@ +# -*- coding: utf-8 -*- + +from tests.helper.Stubs import Core, normalUser, adminUser +from tests.helper.BenchmarkTest import BenchmarkTest + +from pyload.database import DatabaseBackend +# disable asyncronous queries +DatabaseBackend.async = DatabaseBackend.queue + +class TestDownloadManager(BenchmarkTest): + + bench = ["add_links", "db"] + + @classmethod + def setUpClass(cls): + cls.c = Core() + cls.db = cls.c.db + cls.db.purgeAll() + + cls.files = cls.c.files + cls.m = cls.c.downloadManager + + @classmethod + def tearDownClass(cls): + cls.db.purgeAll() + cls.db.shutdown() + + def setUp(self): + self.test_add_links() + + def test_add_links(self): + # just generate some links and files + for i in range(10): + pid = self.files.addPackage("name %d", "folder", -1, "", "", "", False, normalUser.uid) + self.files.addLinks([("plugin%d" % i, "url%d" %i) for i in range(50)], pid, normalUser.uid) + + def test_db(self): + pass + + +if __name__ == "__main__": + TestDownloadManager.benchmark() \ No newline at end of file -- cgit v1.2.3