From 66aa1331fced51221349381230c9eec86fe9ee71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Gra=C3=B1a?= Date: Tue, 16 Jul 2013 00:49:35 -0300 Subject: [PATCH] Twisted pre 10.2 (lucid) can not setup the required ftp server for tests --- scrapy/tests/test_downloader_handlers.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/scrapy/tests/test_downloader_handlers.py b/scrapy/tests/test_downloader_handlers.py index 857cd3c9b..c71bfbcb8 100644 --- a/scrapy/tests/test_downloader_handlers.py +++ b/scrapy/tests/test_downloader_handlers.py @@ -11,9 +11,10 @@ from twisted.web.test.test_webclient import ForeverTakingResource, \ PayloadResource, BrokenDownloadResource from twisted.protocols.ftp import FTPRealm, FTPFactory from twisted.cred import portal, checkers, credentials -from twisted.protocols.ftp import FTPClient, ConnectionLost +from twisted.protocols.ftp import FTPClient, ConnectionLost from w3lib.url import path_to_file_uri +from scrapy import twisted_version from scrapy.core.downloader.handlers.file import FileDownloadHandler from scrapy.core.downloader.handlers.http import HTTPDownloadHandler, HttpDownloadHandler from scrapy.core.downloader.handlers.http10 import HTTP10DownloadHandler @@ -333,10 +334,13 @@ class S3TestCase(unittest.TestCase): 'AWS 0PN5J17HBGZHT7JJ3X82:C0FlOtU8Ylb9KDTpZqYkZPX91iI=') class FTPTestCase(unittest.TestCase): - + username = "scrapy" password = "passwd" + if twisted_version < (10, 2, 0): + skip = "Twisted pre 10.2.0 doesn't allow to set home path other than /home" + def setUp(self): # setup dirs and test file self.directory = self.mktemp()