don't fail if OpenSSL is not installed in test_dependencies.py

This commit is contained in:
Pablo Hoffman 2009-12-02 11:26:34 -02:00
parent 07344666e2
commit dda7e01d2f
1 changed files with 5 additions and 5 deletions

View File

@ -1,11 +1,11 @@
from unittest import TestCase, main
from twisted.trial import unittest
class ScrapyUtilsTest(TestCase):
def test_openssl(self):
class ScrapyUtilsTest(unittest.TestCase):
def test_required_openssl_version(self):
try:
module = __import__('OpenSSL', {}, {}, [''])
except ImportError, ex:
return # no openssl installed
raise unittest.SkipTest("OpenSSL is not available")
required_version = '0.6'
if hasattr(module, '__version__'):
@ -13,4 +13,4 @@ class ScrapyUtilsTest(TestCase):
self.assertFalse(cur < req, "module %s >= %s required" % ('OpenSSL', required_version))
if __name__ == "__main__":
main()
unittest.main()