diff options
author | 2013-07-19 19:36:05 +0200 | |
---|---|---|
committer | 2013-07-19 19:36:17 +0200 | |
commit | 873f91be7d3316e93672731e2f3d2da02b41fca6 (patch) | |
tree | 5a12d1a5ac1f0a4aa5fca9ab9e6b86e64f25e388 /tests/other/test_requestFactory.py | |
parent | Explain how to add tips for translators (diff) | |
download | pyload-873f91be7d3316e93672731e2f3d2da02b41fca6.tar.xz |
new plugin type and refactored request classes
Diffstat (limited to 'tests/other/test_requestFactory.py')
-rw-r--r-- | tests/other/test_requestFactory.py | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/tests/other/test_requestFactory.py b/tests/other/test_requestFactory.py new file mode 100644 index 000000000..734d9c1fb --- /dev/null +++ b/tests/other/test_requestFactory.py @@ -0,0 +1,30 @@ +# -*- coding: utf-8 -*- + +from tests.helper.Stubs import Core + +from pyload.plugins.network.CurlRequest import CurlRequest +from pyload.network.RequestFactory import RequestFactory + +class TestRequestFactory: + + @classmethod + def setUpClass(cls): + cls.req = RequestFactory(Core()) + + def test_get_request(self): + req = self.req.getRequest() + + new_req = self.req.getRequest(req.getContext()) + assert new_req.getContext() == req.getContext() + + def test_get_request_class(self): + + self.req.getRequest(None, CurlRequest) + + def test_get_download(self): + dl = self.req.getDownloadRequest() + dl.close() + + # with given request + dl = self.req.getDownloadRequest(self.req.getRequest()) + dl.close()
\ No newline at end of file |