Merge pull request #20266 from cachedout/tornado_version_detect

Tornado version detect
This commit is contained in:
Mike Place 2015-01-30 16:03:18 -07:00
commit eef6519830

View File

@ -3,6 +3,7 @@
# Import Python Libs # Import Python Libs
import json import json
import time import time
from distutils.version import StrictVersion
# Import Salt Libs # Import Salt Libs
from salt.netapi.rest_tornado import saltnado from salt.netapi.rest_tornado import saltnado
@ -21,6 +22,7 @@ except ImportError:
HAS_TORNADO = False HAS_TORNADO = False
try: try:
import zmq
from zmq.eventloop.ioloop import ZMQIOLoop from zmq.eventloop.ioloop import ZMQIOLoop
HAS_ZMQ_IOLOOP = True HAS_ZMQ_IOLOOP = True
except ImportError: except ImportError:
@ -29,6 +31,7 @@ except ImportError:
@skipIf(HAS_TORNADO is False, 'Tornado must be installed to run these tests') @skipIf(HAS_TORNADO is False, 'Tornado must be installed to run these tests')
@skipIf(HAS_ZMQ_IOLOOP is False, 'PyZMQ version must be >= 14.0.1 to run these tests.') @skipIf(HAS_ZMQ_IOLOOP is False, 'PyZMQ version must be >= 14.0.1 to run these tests.')
@skipIf(StrictVersion(zmq.__version__) < StrictVersion('14.0.1'), 'PyZMQ must be >= 14.0.1 to run these tests.')
class TestSaltAPIHandler(SaltnadoTestCase): class TestSaltAPIHandler(SaltnadoTestCase):
def get_app(self): def get_app(self):
application = tornado.web.Application([('/', saltnado.SaltAPIHandler)], debug=True) application = tornado.web.Application([('/', saltnado.SaltAPIHandler)], debug=True)