optional_features has been removed

This commit is contained in:
Daniel Graña 2016-01-19 15:34:26 -03:00
parent 5ec4319885
commit 176610f910
1 changed files with 8 additions and 5 deletions

View File

@ -431,8 +431,12 @@ class HttpDownloadHandlerMock(object):
def download_request(self, request, spider):
return request
class S3AnonTestCase(unittest.TestCase):
skip = 'boto' not in optional_features and 'missing boto library'
try:
import boto
except ImportError:
skip = 'missing boto library'
def setUp(self):
self.s3reqh = S3DownloadHandler(Settings(),
@ -448,14 +452,13 @@ class S3AnonTestCase(unittest.TestCase):
self.assertEqual(hasattr(self.s3reqh.conn, 'anon'), True)
self.assertEqual(self.s3reqh.conn.anon, True)
class S3TestCase(unittest.TestCase):
download_handler_cls = S3DownloadHandler
try:
# can't instance without settings, but ignore that
download_handler_cls({})
except NotConfigured:
import boto
except ImportError:
skip = 'missing boto library'
except KeyError: pass
# test use same example keys than amazon developer guide
# http://s3.amazonaws.com/awsdocs/S3/20060301/s3-dg-20060301.pdf