from twisted.trial import unittest

class ScrapyUtilsTest(unittest.TestCase):
    def test_required_openssl_version(self):
        try:
            module = __import__('OpenSSL', {}, {}, [''])
        except ImportError, ex:
            raise unittest.SkipTest("OpenSSL is not available")

        if hasattr(module, '__version__'):
            installed_version = map(int, module.__version__.split('.')[:2])
            assert installed_version >= [0, 6], "OpenSSL >= 0.6 required"

if __name__ == "__main__":
    unittest.main()
