mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 17:09:03 +00:00
Merge pull request #41657 from gtmanfred/nitrogen
Disable libcloud test if the module doesn't load
This commit is contained in:
commit
55ac7312bf
@ -1,9 +1,25 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from __future__ import absolute_import
|
from __future__ import absolute_import
|
||||||
|
|
||||||
|
# import salt libs
|
||||||
|
from salt.utils.versions import LooseVersion as _LooseVersion
|
||||||
|
|
||||||
|
# Import test Helpers
|
||||||
from tests.support.case import ModuleCase
|
from tests.support.case import ModuleCase
|
||||||
|
from tests.support.unit import skipIf
|
||||||
|
|
||||||
|
REQUIRED_LIBCLOUD_VERSION = '0.21.0'
|
||||||
|
try:
|
||||||
|
import libcloud
|
||||||
|
#pylint: enable=unused-import
|
||||||
|
if _LooseVersion(getattr(libcloud, '__version__', '0.0.0')) < _LooseVersion(REQUIRED_LIBCLOUD_VERSION):
|
||||||
|
raise ImportError()
|
||||||
|
HAS_LIBCLOUD = True
|
||||||
|
except ImportError:
|
||||||
|
HAS_LIBCLOUD = False
|
||||||
|
|
||||||
|
|
||||||
|
@skipIf(not HAS_LIBCLOUD, 'Requires libcloud >= {0}'.format(REQUIRED_LIBCLOUD_VERSION))
|
||||||
class LibcloudDNSTest(ModuleCase):
|
class LibcloudDNSTest(ModuleCase):
|
||||||
'''
|
'''
|
||||||
Validate the libcloud_dns module
|
Validate the libcloud_dns module
|
||||||
|
Loading…
Reference in New Issue
Block a user