summaryrefslogtreecommitdiffstats
path: root/tests/other/test_curlDownload.py
diff options
context:
space:
mode:
authorGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2013-07-19 19:36:05 +0200
committerGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2013-07-19 19:36:17 +0200
commit873f91be7d3316e93672731e2f3d2da02b41fca6 (patch)
tree5a12d1a5ac1f0a4aa5fca9ab9e6b86e64f25e388 /tests/other/test_curlDownload.py
parentExplain how to add tips for translators (diff)
downloadpyload-873f91be7d3316e93672731e2f3d2da02b41fca6.tar.xz
new plugin type and refactored request classes
Diffstat (limited to 'tests/other/test_curlDownload.py')
-rw-r--r--tests/other/test_curlDownload.py30
1 files changed, 30 insertions, 0 deletions
diff --git a/tests/other/test_curlDownload.py b/tests/other/test_curlDownload.py
new file mode 100644
index 000000000..d3f8f6754
--- /dev/null
+++ b/tests/other/test_curlDownload.py
@@ -0,0 +1,30 @@
+# -*- coding: utf-8 -*-
+
+from os import stat
+from os.path import exists
+
+from tests.helper.Stubs import Core
+from pyload.network.Bucket import Bucket
+from pyload.plugins.network.CurlDownload import CurlDownload
+
+class TestCurlRequest:
+
+ def setUp(self):
+ self.dl = CurlDownload(Bucket())
+
+ def tearDown(self):
+ self.dl.close()
+
+ def test_download(self):
+
+ self.dl.download("http://pyload.org/lib/tpl/pyload/images/pyload-logo-edited3.5-new-font-small.png", "/tmp/random.bin")
+
+ print self.dl.size, self.dl.arrived
+ assert self.dl.size == self.dl.arrived > 0
+ assert stat("/tmp/random.bin").st_size == self.dl.size
+
+
+ def test_attributes(self):
+ assert self.dl.size == 0
+ assert self.dl.speed == 0
+ assert self.dl.arrived == 0 \ No newline at end of file