summaryrefslogtreecommitdiffstats
path: root/tests/other
diff options
context:
space:
mode:
authorGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2013-07-21 17:03:54 +0200
committerGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2013-07-21 17:03:54 +0200
commit6406e9c1b8ab2792427128bd950137066b495fb4 (patch)
treec717f7b8d5a3d1a61f12e6240c1bbc75235dae0c /tests/other
parentPaver task to automatically fix module imports (diff)
downloadpyload-6406e9c1b8ab2792427128bd950137066b495fb4.tar.xz
additional test for curl request
Diffstat (limited to 'tests/other')
-rw-r--r--tests/other/test_curlRequest.py21
1 files changed, 16 insertions, 5 deletions
diff --git a/tests/other/test_curlRequest.py b/tests/other/test_curlRequest.py
index 0982d896d..09d65b385 100644
--- a/tests/other/test_curlRequest.py
+++ b/tests/other/test_curlRequest.py
@@ -3,8 +3,12 @@
from tests.helper.Stubs import Core
from pyload.plugins.network.CurlRequest import CurlRequest
+from unittest import TestCase
-class TestCurlRequest:
+
+class TestCurlRequest(TestCase):
+ # This page provides a test which prints all set cookies
+ cookieURL = "http://forum.pyload.org"
def setUp(self):
self.req = CurlRequest({})
@@ -16,13 +20,20 @@ class TestCurlRequest:
self.req.load("http://pyload.org")
def test_cookies(self):
-
- self.req.load("http://pyload.org", cookies=False)
+ self.req.load(self.cookieURL, cookies=False)
assert len(self.req.cj.values()) == 0
- self.req.load("http://pyload.org")
+ self.req.load(self.cookieURL)
assert len(self.req.cj.values()) > 0
- def test_auth(self):
+ for c in self.req.load(self.cookieURL + "/cookies.php").splitlines():
+ k, v = c.strip().split(":")
+ self.assertIn(k, self.req.cj)
+ self.assertEqual(v, self.req.cj[k].value)
+ cookies = self.req.load(self.cookieURL + "/cookies.php", cookies=False)
+ self.assertEqual(cookies, "")
+
+
+ def test_auth(self):
pass \ No newline at end of file