From 176610f91068cb9663be184094e450de0aac77bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Gra=C3=B1a?= Date: Tue, 19 Jan 2016 15:34:26 -0300 Subject: [PATCH] optional_features has been removed --- tests/test_downloader_handlers.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/tests/test_downloader_handlers.py b/tests/test_downloader_handlers.py index a474b75d2..1eb6192ce 100644 --- a/tests/test_downloader_handlers.py +++ b/tests/test_downloader_handlers.py @@ -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