diff --git a/tests/test_httpdownloader.py b/tests/test_httpdownloader.py new file mode 100644 index 000000000..e2dda2fd9 --- /dev/null +++ b/tests/test_httpdownloader.py @@ -0,0 +1,28 @@ +from twisted.trial import unittest +from twisted.python.failure import Failure + +from deluge.httpdownloader import download_file + +class DownloadFileTestCase(unittest.TestCase): + def test_download(self): + d = download_file("http://deluge-torrent.org", "index.html") + d.addCallback(self.assertEqual, "index.html") + return d + + def test_download_with_cookies(self): + pass + + def test_page_moved(self): + pass + + def test_page_moved_permanently(self): + pass + + def test_page_not_modified(self): + pass + + def test_page_not_found(self): + d = download_file("http://does.not.exist", "none") + d.addCallback(self.fail) + d.addErrback(self.assertIsInstance, Failure) + return d