summaryrefslogtreecommitdiffstats
path: root/tests/other/test_curlDownload.py
diff options
context:
space:
mode:
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