Fix httpdownloader Tests

This commit is contained in:
Calum Lind 2011-07-07 21:36:47 +01:00
parent ed229d2ace
commit 2d09035dc4

View File

@ -60,10 +60,11 @@ class DownloadFileTestCase(unittest.TestCase):
d.addCallback(self.assertContains, "This file should be called renamed") d.addCallback(self.assertContains, "This file should be called renamed")
return d return d
def test_download_with_rename_fail(self): def test_download_with_rename_exists(self):
open('renamed', 'w').close()
url = "http://deluge-torrent.org/httpdownloader.php?test=rename&filename=renamed" url = "http://deluge-torrent.org/httpdownloader.php?test=rename&filename=renamed"
d = download_file(url, "original") d = download_file(url, "original")
d.addCallback(self.assertEqual, "original") d.addCallback(self.assertEqual, "renamed-1")
d.addCallback(self.assertContains, "This file should be called renamed") d.addCallback(self.assertContains, "This file should be called renamed")
return d return d