Add test file for httpdownloader.

This commit is contained in:
John Garland 2009-07-31 23:53:23 +00:00
parent d5f7df8a96
commit eef9345e8b
1 changed files with 28 additions and 0 deletions

View File

@ -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