mirror of
https://github.com/saltstack/salt.git
synced 2025-04-16 09:40:20 +00:00
By these days, we should blowup if mock is not available
This commit is contained in:
parent
23da8fc6be
commit
ba94b4b878
591 changed files with 641 additions and 2369 deletions
|
@ -8,16 +8,11 @@ from __future__ import absolute_import, unicode_literals, print_function
|
||||||
|
|
||||||
# Import Salt Testing Libs
|
# Import Salt Testing Libs
|
||||||
from tests.support.mixins import LoaderModuleMockMixin
|
from tests.support.mixins import LoaderModuleMockMixin
|
||||||
from tests.support.unit import TestCase, skipIf
|
from tests.support.unit import TestCase
|
||||||
from tests.support.mock import (
|
from tests.support.mock import patch
|
||||||
patch,
|
|
||||||
NO_MOCK,
|
|
||||||
NO_MOCK_REASON
|
|
||||||
)
|
|
||||||
import salt.modules.{{module_name}} as {{module_name}}
|
import salt.modules.{{module_name}} as {{module_name}}
|
||||||
|
|
||||||
|
|
||||||
@skipIf(NO_MOCK, NO_MOCK_REASON)
|
|
||||||
class {{module_name|capitalize}}TestCase(TestCase, LoaderModuleMockMixin):
|
class {{module_name|capitalize}}TestCase(TestCase, LoaderModuleMockMixin):
|
||||||
|
|
||||||
def setup_loader_modules(self):
|
def setup_loader_modules(self):
|
||||||
|
|
|
@ -8,17 +8,11 @@ from __future__ import absolute_import, unicode_literals, print_function
|
||||||
|
|
||||||
# Import Salt Testing Libs
|
# Import Salt Testing Libs
|
||||||
from tests.support.mixins import LoaderModuleMockMixin
|
from tests.support.mixins import LoaderModuleMockMixin
|
||||||
from tests.support.unit import TestCase, skipIf
|
from tests.support.unit import TestCase
|
||||||
from tests.support.mock import (
|
from tests.support.mock import patch
|
||||||
patch,
|
|
||||||
NO_MOCK,
|
|
||||||
NO_MOCK_REASON
|
|
||||||
)
|
|
||||||
import salt.states.{{module_name}} as {{module_name}}
|
import salt.states.{{module_name}} as {{module_name}}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@skipIf(NO_MOCK, NO_MOCK_REASON)
|
|
||||||
class {{module_name|capitalize}}TestCase(TestCase, LoaderModuleMockMixin):
|
class {{module_name|capitalize}}TestCase(TestCase, LoaderModuleMockMixin):
|
||||||
|
|
||||||
def setup_loader_modules(self):
|
def setup_loader_modules(self):
|
||||||
|
|
|
@ -81,7 +81,6 @@ from tests.support.helpers import (
|
||||||
requires_system_grains,
|
requires_system_grains,
|
||||||
skip_if_not_root
|
skip_if_not_root
|
||||||
)
|
)
|
||||||
from tests.support.mock import NO_MOCK, NO_MOCK_REASON
|
|
||||||
from tests.support.unit import skipIf
|
from tests.support.unit import skipIf
|
||||||
|
|
||||||
# Import Salt libs
|
# Import Salt libs
|
||||||
|
@ -517,7 +516,6 @@ class GitPythonMixin(object):
|
||||||
|
|
||||||
|
|
||||||
@destructiveTest
|
@destructiveTest
|
||||||
@skipIf(NO_MOCK, NO_MOCK_REASON)
|
|
||||||
@skipIf(_windows_or_mac(), 'minion is windows or mac')
|
@skipIf(_windows_or_mac(), 'minion is windows or mac')
|
||||||
@skip_if_not_root
|
@skip_if_not_root
|
||||||
@skipIf(not HAS_GITPYTHON, 'GitPython >= {0} required'.format(GITPYTHON_MINVER))
|
@skipIf(not HAS_GITPYTHON, 'GitPython >= {0} required'.format(GITPYTHON_MINVER))
|
||||||
|
@ -532,7 +530,6 @@ class TestGitPythonSSH(GitPillarSSHTestBase, GitPythonMixin):
|
||||||
passphrase = PASSWORD
|
passphrase = PASSWORD
|
||||||
|
|
||||||
|
|
||||||
@skipIf(NO_MOCK, NO_MOCK_REASON)
|
|
||||||
@skipIf(_windows_or_mac(), 'minion is windows or mac')
|
@skipIf(_windows_or_mac(), 'minion is windows or mac')
|
||||||
@skip_if_not_root
|
@skip_if_not_root
|
||||||
@skipIf(not HAS_GITPYTHON, 'GitPython >= {0} required'.format(GITPYTHON_MINVER))
|
@skipIf(not HAS_GITPYTHON, 'GitPython >= {0} required'.format(GITPYTHON_MINVER))
|
||||||
|
@ -545,7 +542,6 @@ class TestGitPythonHTTP(GitPillarHTTPTestBase, GitPythonMixin):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
@skipIf(NO_MOCK, NO_MOCK_REASON)
|
|
||||||
@skipIf(_windows_or_mac(), 'minion is windows or mac')
|
@skipIf(_windows_or_mac(), 'minion is windows or mac')
|
||||||
@skip_if_not_root
|
@skip_if_not_root
|
||||||
@skipIf(not HAS_GITPYTHON, 'GitPython >= {0} required'.format(GITPYTHON_MINVER))
|
@skipIf(not HAS_GITPYTHON, 'GitPython >= {0} required'.format(GITPYTHON_MINVER))
|
||||||
|
@ -581,7 +577,6 @@ class TestGitPythonAuthenticatedHTTP(TestGitPythonHTTP, GitPythonMixin):
|
||||||
|
|
||||||
|
|
||||||
@destructiveTest
|
@destructiveTest
|
||||||
@skipIf(NO_MOCK, NO_MOCK_REASON)
|
|
||||||
@skipIf(_windows_or_mac(), 'minion is windows or mac')
|
@skipIf(_windows_or_mac(), 'minion is windows or mac')
|
||||||
@skip_if_not_root
|
@skip_if_not_root
|
||||||
@skipIf(not HAS_PYGIT2, 'pygit2 >= {0} and libgit2 >= {1} required'.format(PYGIT2_MINVER, LIBGIT2_MINVER))
|
@skipIf(not HAS_PYGIT2, 'pygit2 >= {0} and libgit2 >= {1} required'.format(PYGIT2_MINVER, LIBGIT2_MINVER))
|
||||||
|
@ -1867,7 +1862,6 @@ class TestPygit2SSH(GitPillarSSHTestBase):
|
||||||
self.assertEqual(ret, expected)
|
self.assertEqual(ret, expected)
|
||||||
|
|
||||||
|
|
||||||
@skipIf(NO_MOCK, NO_MOCK_REASON)
|
|
||||||
@skipIf(_windows_or_mac(), 'minion is windows or mac')
|
@skipIf(_windows_or_mac(), 'minion is windows or mac')
|
||||||
@skip_if_not_root
|
@skip_if_not_root
|
||||||
@skipIf(not HAS_PYGIT2, 'pygit2 >= {0} and libgit2 >= {1} required'.format(PYGIT2_MINVER, LIBGIT2_MINVER))
|
@skipIf(not HAS_PYGIT2, 'pygit2 >= {0} and libgit2 >= {1} required'.format(PYGIT2_MINVER, LIBGIT2_MINVER))
|
||||||
|
@ -2271,7 +2265,6 @@ class TestPygit2HTTP(GitPillarHTTPTestBase):
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@skipIf(NO_MOCK, NO_MOCK_REASON)
|
|
||||||
@skipIf(_windows_or_mac(), 'minion is windows or mac')
|
@skipIf(_windows_or_mac(), 'minion is windows or mac')
|
||||||
@skip_if_not_root
|
@skip_if_not_root
|
||||||
@skipIf(not HAS_PYGIT2, 'pygit2 >= {0} and libgit2 >= {1} required'.format(PYGIT2_MINVER, LIBGIT2_MINVER))
|
@skipIf(not HAS_PYGIT2, 'pygit2 >= {0} and libgit2 >= {1} required'.format(PYGIT2_MINVER, LIBGIT2_MINVER))
|
||||||
|
|
|
@ -26,7 +26,7 @@ import subprocess
|
||||||
import multiprocessing
|
import multiprocessing
|
||||||
|
|
||||||
# Import Salt Testing Libs
|
# Import Salt Testing Libs
|
||||||
from tests.support.mock import NO_MOCK, NO_MOCK_REASON, patch
|
from tests.support.mock import patch
|
||||||
from tests.support.runtests import RUNTIME_VARS
|
from tests.support.runtests import RUNTIME_VARS
|
||||||
from tests.support.paths import CODE_DIR
|
from tests.support.paths import CODE_DIR
|
||||||
|
|
||||||
|
@ -423,9 +423,6 @@ class LoaderModuleMockMixin(six.with_metaclass(_FixLoaderModuleMockMixinMroOrder
|
||||||
|
|
||||||
@functools.wraps(setup_func)
|
@functools.wraps(setup_func)
|
||||||
def wrapper(self):
|
def wrapper(self):
|
||||||
if NO_MOCK:
|
|
||||||
self.skipTest(NO_MOCK_REASON)
|
|
||||||
|
|
||||||
loader_modules_configs = self.setup_loader_modules()
|
loader_modules_configs = self.setup_loader_modules()
|
||||||
if not isinstance(loader_modules_configs, dict):
|
if not isinstance(loader_modules_configs, dict):
|
||||||
raise RuntimeError(
|
raise RuntimeError(
|
||||||
|
|
|
@ -25,75 +25,26 @@ import sys
|
||||||
from salt.ext import six
|
from salt.ext import six
|
||||||
import salt.utils.stringutils
|
import salt.utils.stringutils
|
||||||
|
|
||||||
try:
|
# By these days, we should blowup if mock is not available
|
||||||
from mock import (
|
import mock # pylint: disable=blacklisted-external-import
|
||||||
Mock,
|
__mock_version = tuple([int(part) for part in mock.__version__.split('.') if part.isdigit()]) # pylint: disable=no-member
|
||||||
MagicMock,
|
if sys.version_info < (3, 6) and __mock_version < (2,):
|
||||||
patch,
|
# We need mock >= 2.0.0 before Py3.6
|
||||||
sentinel,
|
raise ImportError('Please install mock>=2.0.0')
|
||||||
DEFAULT,
|
|
||||||
# ANY and call will be imported further down
|
|
||||||
create_autospec,
|
|
||||||
FILTER_DIR,
|
|
||||||
NonCallableMock,
|
|
||||||
NonCallableMagicMock,
|
|
||||||
PropertyMock,
|
|
||||||
__version__
|
|
||||||
)
|
|
||||||
NO_MOCK = False
|
|
||||||
NO_MOCK_REASON = ''
|
|
||||||
mock_version = []
|
|
||||||
for __part in __version__.split('.'):
|
|
||||||
try:
|
|
||||||
mock_version.append(int(__part))
|
|
||||||
except ValueError:
|
|
||||||
# Non-integer value (ex. '1a')
|
|
||||||
mock_version.append(__part)
|
|
||||||
mock_version = tuple(mock_version)
|
|
||||||
except ImportError as exc:
|
|
||||||
NO_MOCK = True
|
|
||||||
NO_MOCK_REASON = 'mock python module is unavailable'
|
|
||||||
mock_version = (0, 0, 0)
|
|
||||||
|
|
||||||
# Let's not fail on imports by providing fake objects and classes
|
from mock import (Mock, # pylint: disable=no-name-in-module,no-member
|
||||||
|
MagicMock,
|
||||||
class MagicMock(object):
|
patch,
|
||||||
|
sentinel,
|
||||||
# __name__ can't be assigned a unicode
|
DEFAULT,
|
||||||
__name__ = str('{0}.fakemock').format(__name__) # future lint: disable=blacklisted-function
|
create_autospec,
|
||||||
|
FILTER_DIR,
|
||||||
def __init__(self, *args, **kwargs):
|
NonCallableMock,
|
||||||
pass
|
NonCallableMagicMock,
|
||||||
|
PropertyMock,
|
||||||
def dict(self, *args, **kwargs):
|
__version__,
|
||||||
return self
|
ANY,
|
||||||
|
call)
|
||||||
def multiple(self, *args, **kwargs):
|
|
||||||
return self
|
|
||||||
|
|
||||||
def __call__(self, *args, **kwargs):
|
|
||||||
return self
|
|
||||||
|
|
||||||
Mock = MagicMock
|
|
||||||
patch = MagicMock()
|
|
||||||
sentinel = object()
|
|
||||||
DEFAULT = object()
|
|
||||||
create_autospec = MagicMock()
|
|
||||||
FILTER_DIR = True
|
|
||||||
NonCallableMock = MagicMock()
|
|
||||||
NonCallableMagicMock = MagicMock()
|
|
||||||
mock_open = object()
|
|
||||||
PropertyMock = object()
|
|
||||||
call = tuple
|
|
||||||
ANY = object()
|
|
||||||
|
|
||||||
|
|
||||||
if NO_MOCK is False:
|
|
||||||
try:
|
|
||||||
from mock import call, ANY
|
|
||||||
except ImportError:
|
|
||||||
NO_MOCK = True
|
|
||||||
NO_MOCK_REASON = 'you need to upgrade your mock version to >= 0.8.0'
|
|
||||||
|
|
||||||
|
|
||||||
class MockFH(object):
|
class MockFH(object):
|
||||||
|
|
|
@ -7,7 +7,7 @@ from __future__ import absolute_import
|
||||||
import salt.auth.ldap
|
import salt.auth.ldap
|
||||||
|
|
||||||
# Import Salt Testing Libs
|
# Import Salt Testing Libs
|
||||||
from tests.support.mock import patch, NO_MOCK, NO_MOCK_REASON
|
from tests.support.mock import patch
|
||||||
from tests.support.unit import skipIf, TestCase
|
from tests.support.unit import skipIf, TestCase
|
||||||
|
|
||||||
salt.auth.ldap.__opts__ = {}
|
salt.auth.ldap.__opts__ = {}
|
||||||
|
@ -28,7 +28,6 @@ class Bind(object):
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
@skipIf(NO_MOCK, NO_MOCK_REASON)
|
|
||||||
@skipIf(not salt.auth.ldap.HAS_LDAP, 'Install python-ldap for this test')
|
@skipIf(not salt.auth.ldap.HAS_LDAP, 'Install python-ldap for this test')
|
||||||
class LDAPAuthTestCase(TestCase):
|
class LDAPAuthTestCase(TestCase):
|
||||||
'''
|
'''
|
||||||
|
|
|
@ -4,15 +4,14 @@
|
||||||
from __future__ import absolute_import
|
from __future__ import absolute_import
|
||||||
|
|
||||||
# Salt testing libs
|
# Salt testing libs
|
||||||
from tests.support.unit import skipIf, TestCase
|
from tests.support.unit import TestCase
|
||||||
from tests.support.mock import NO_MOCK, NO_MOCK_REASON, patch, Mock
|
from tests.support.mock import patch, Mock
|
||||||
from tests.support.mixins import LoaderModuleMockMixin
|
from tests.support.mixins import LoaderModuleMockMixin
|
||||||
|
|
||||||
# Salt libs
|
# Salt libs
|
||||||
import salt.beacons.adb as adb
|
import salt.beacons.adb as adb
|
||||||
|
|
||||||
|
|
||||||
@skipIf(NO_MOCK, NO_MOCK_REASON)
|
|
||||||
class ADBBeaconTestCase(TestCase, LoaderModuleMockMixin):
|
class ADBBeaconTestCase(TestCase, LoaderModuleMockMixin):
|
||||||
'''
|
'''
|
||||||
Test case for salt.beacons.adb
|
Test case for salt.beacons.adb
|
||||||
|
|
|
@ -4,15 +4,13 @@
|
||||||
from __future__ import absolute_import
|
from __future__ import absolute_import
|
||||||
|
|
||||||
# Salt testing libs
|
# Salt testing libs
|
||||||
from tests.support.unit import skipIf, TestCase
|
from tests.support.unit import TestCase
|
||||||
from tests.support.mock import NO_MOCK, NO_MOCK_REASON
|
|
||||||
from tests.support.mixins import LoaderModuleMockMixin
|
from tests.support.mixins import LoaderModuleMockMixin
|
||||||
|
|
||||||
# Salt libs
|
# Salt libs
|
||||||
import salt.beacons.avahi_announce as avahi_announce
|
import salt.beacons.avahi_announce as avahi_announce
|
||||||
|
|
||||||
|
|
||||||
@skipIf(NO_MOCK, NO_MOCK_REASON)
|
|
||||||
class AvahiAnnounceBeaconTestCase(TestCase, LoaderModuleMockMixin):
|
class AvahiAnnounceBeaconTestCase(TestCase, LoaderModuleMockMixin):
|
||||||
'''
|
'''
|
||||||
Test case for salt.beacons.avahi_announce
|
Test case for salt.beacons.avahi_announce
|
||||||
|
|
|
@ -4,15 +4,13 @@
|
||||||
from __future__ import absolute_import
|
from __future__ import absolute_import
|
||||||
|
|
||||||
# Salt testing libs
|
# Salt testing libs
|
||||||
from tests.support.unit import skipIf, TestCase
|
from tests.support.unit import TestCase
|
||||||
from tests.support.mock import NO_MOCK, NO_MOCK_REASON
|
|
||||||
from tests.support.mixins import LoaderModuleMockMixin
|
from tests.support.mixins import LoaderModuleMockMixin
|
||||||
|
|
||||||
# Salt libs
|
# Salt libs
|
||||||
import salt.beacons.bonjour_announce as bonjour_announce
|
import salt.beacons.bonjour_announce as bonjour_announce
|
||||||
|
|
||||||
|
|
||||||
@skipIf(NO_MOCK, NO_MOCK_REASON)
|
|
||||||
class BonjourAnnounceBeaconTestCase(TestCase, LoaderModuleMockMixin):
|
class BonjourAnnounceBeaconTestCase(TestCase, LoaderModuleMockMixin):
|
||||||
'''
|
'''
|
||||||
Test case for salt.beacons.avahi_announce
|
Test case for salt.beacons.avahi_announce
|
||||||
|
|
|
@ -7,7 +7,7 @@ import logging
|
||||||
|
|
||||||
# Salt testing libs
|
# Salt testing libs
|
||||||
from tests.support.unit import skipIf, TestCase
|
from tests.support.unit import skipIf, TestCase
|
||||||
from tests.support.mock import NO_MOCK, NO_MOCK_REASON, patch, MagicMock, mock_open
|
from tests.support.mock import patch, MagicMock, mock_open
|
||||||
from tests.support.mixins import LoaderModuleMockMixin
|
from tests.support.mixins import LoaderModuleMockMixin
|
||||||
|
|
||||||
# Salt libs
|
# Salt libs
|
||||||
|
@ -27,7 +27,6 @@ pack = (6, 29774, b'ssh:notty\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
@skipIf(NO_MOCK, NO_MOCK_REASON)
|
|
||||||
class BTMPBeaconTestCase(TestCase, LoaderModuleMockMixin):
|
class BTMPBeaconTestCase(TestCase, LoaderModuleMockMixin):
|
||||||
'''
|
'''
|
||||||
Test case for salt.beacons.[s]
|
Test case for salt.beacons.[s]
|
||||||
|
|
|
@ -5,8 +5,8 @@ from __future__ import absolute_import
|
||||||
from collections import namedtuple
|
from collections import namedtuple
|
||||||
|
|
||||||
# Salt testing libs
|
# Salt testing libs
|
||||||
from tests.support.unit import skipIf, TestCase
|
from tests.support.unit import TestCase
|
||||||
from tests.support.mock import NO_MOCK, NO_MOCK_REASON, patch, MagicMock, Mock
|
from tests.support.mock import patch, MagicMock, Mock
|
||||||
from tests.support.mixins import LoaderModuleMockMixin
|
from tests.support.mixins import LoaderModuleMockMixin
|
||||||
|
|
||||||
# Salt libs
|
# Salt libs
|
||||||
|
@ -48,7 +48,6 @@ WINDOWS_STUB_DISK_USAGE = namedtuple('usage',
|
||||||
50)
|
50)
|
||||||
|
|
||||||
|
|
||||||
@skipIf(NO_MOCK, NO_MOCK_REASON)
|
|
||||||
class DiskUsageBeaconTestCase(TestCase, LoaderModuleMockMixin):
|
class DiskUsageBeaconTestCase(TestCase, LoaderModuleMockMixin):
|
||||||
'''
|
'''
|
||||||
Test case for salt.beacons.adb
|
Test case for salt.beacons.adb
|
||||||
|
|
|
@ -7,14 +7,13 @@ from __future__ import absolute_import
|
||||||
import salt.beacons.glxinfo as glxinfo
|
import salt.beacons.glxinfo as glxinfo
|
||||||
|
|
||||||
# Salt testing libs
|
# Salt testing libs
|
||||||
from tests.support.unit import skipIf, TestCase
|
from tests.support.unit import TestCase
|
||||||
from tests.support.mock import NO_MOCK, NO_MOCK_REASON, patch, Mock
|
from tests.support.mock import patch, Mock
|
||||||
|
|
||||||
# Import test suite libs
|
# Import test suite libs
|
||||||
from tests.support.mixins import LoaderModuleMockMixin
|
from tests.support.mixins import LoaderModuleMockMixin
|
||||||
|
|
||||||
|
|
||||||
@skipIf(NO_MOCK, NO_MOCK_REASON)
|
|
||||||
class GLXInfoBeaconTestCase(TestCase, LoaderModuleMockMixin):
|
class GLXInfoBeaconTestCase(TestCase, LoaderModuleMockMixin):
|
||||||
'''
|
'''
|
||||||
Test case for salt.beacons.glxinfo
|
Test case for salt.beacons.glxinfo
|
||||||
|
|
|
@ -4,15 +4,14 @@
|
||||||
from __future__ import absolute_import
|
from __future__ import absolute_import
|
||||||
|
|
||||||
# Salt testing libs
|
# Salt testing libs
|
||||||
from tests.support.unit import skipIf, TestCase
|
from tests.support.unit import TestCase
|
||||||
from tests.support.mock import NO_MOCK, NO_MOCK_REASON, patch, MagicMock
|
from tests.support.mock import patch, MagicMock
|
||||||
from tests.support.mixins import LoaderModuleMockMixin
|
from tests.support.mixins import LoaderModuleMockMixin
|
||||||
|
|
||||||
# Salt libs
|
# Salt libs
|
||||||
import salt.beacons.haproxy as haproxy
|
import salt.beacons.haproxy as haproxy
|
||||||
|
|
||||||
|
|
||||||
@skipIf(NO_MOCK, NO_MOCK_REASON)
|
|
||||||
class HAProxyBeaconTestCase(TestCase, LoaderModuleMockMixin):
|
class HAProxyBeaconTestCase(TestCase, LoaderModuleMockMixin):
|
||||||
'''
|
'''
|
||||||
Test case for salt.beacons.haproxy
|
Test case for salt.beacons.haproxy
|
||||||
|
|
|
@ -6,8 +6,8 @@ import datetime
|
||||||
from uuid import UUID
|
from uuid import UUID
|
||||||
|
|
||||||
# Salt testing libs
|
# Salt testing libs
|
||||||
from tests.support.unit import skipIf, TestCase
|
from tests.support.unit import TestCase
|
||||||
from tests.support.mock import NO_MOCK, NO_MOCK_REASON, Mock
|
from tests.support.mock import Mock
|
||||||
from tests.support.mixins import LoaderModuleMockMixin
|
from tests.support.mixins import LoaderModuleMockMixin
|
||||||
|
|
||||||
# Salt libs
|
# Salt libs
|
||||||
|
@ -74,7 +74,6 @@ class SystemdJournaldMock(Mock):
|
||||||
SYSTEMD_MOCK = SystemdJournaldMock()
|
SYSTEMD_MOCK = SystemdJournaldMock()
|
||||||
|
|
||||||
|
|
||||||
@skipIf(NO_MOCK, NO_MOCK_REASON)
|
|
||||||
class JournaldBeaconTestCase(TestCase, LoaderModuleMockMixin):
|
class JournaldBeaconTestCase(TestCase, LoaderModuleMockMixin):
|
||||||
'''
|
'''
|
||||||
Test case for salt.beacons.journald
|
Test case for salt.beacons.journald
|
||||||
|
|
|
@ -5,7 +5,7 @@ from __future__ import absolute_import
|
||||||
|
|
||||||
# Salt testing libs
|
# Salt testing libs
|
||||||
from tests.support.unit import skipIf, TestCase
|
from tests.support.unit import skipIf, TestCase
|
||||||
from tests.support.mock import NO_MOCK, NO_MOCK_REASON, patch, MagicMock
|
from tests.support.mock import patch, MagicMock
|
||||||
from tests.support.mixins import LoaderModuleMockMixin
|
from tests.support.mixins import LoaderModuleMockMixin
|
||||||
|
|
||||||
# Salt libs
|
# Salt libs
|
||||||
|
@ -16,7 +16,6 @@ import logging
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
@skipIf(NO_MOCK, NO_MOCK_REASON)
|
|
||||||
class LoadBeaconTestCase(TestCase, LoaderModuleMockMixin):
|
class LoadBeaconTestCase(TestCase, LoaderModuleMockMixin):
|
||||||
'''
|
'''
|
||||||
Test case for salt.beacons.load
|
Test case for salt.beacons.load
|
||||||
|
|
|
@ -4,8 +4,8 @@
|
||||||
from __future__ import absolute_import
|
from __future__ import absolute_import
|
||||||
|
|
||||||
# Salt testing libs
|
# Salt testing libs
|
||||||
from tests.support.unit import skipIf, TestCase
|
from tests.support.unit import TestCase
|
||||||
from tests.support.mock import NO_MOCK, NO_MOCK_REASON, patch, mock_open
|
from tests.support.mock import patch, mock_open
|
||||||
from tests.support.mixins import LoaderModuleMockMixin
|
from tests.support.mixins import LoaderModuleMockMixin
|
||||||
|
|
||||||
# Salt libs
|
# Salt libs
|
||||||
|
@ -20,7 +20,6 @@ _STUB_LOG_ENTRY = 'Jun 29 12:58:51 hostname sshd[6536]: ' \
|
||||||
'for user username by (uid=0)\n'
|
'for user username by (uid=0)\n'
|
||||||
|
|
||||||
|
|
||||||
@skipIf(NO_MOCK, NO_MOCK_REASON)
|
|
||||||
class LogBeaconTestCase(TestCase, LoaderModuleMockMixin):
|
class LogBeaconTestCase(TestCase, LoaderModuleMockMixin):
|
||||||
'''
|
'''
|
||||||
Test case for salt.beacons.log
|
Test case for salt.beacons.log
|
||||||
|
|
|
@ -5,8 +5,8 @@ from __future__ import absolute_import
|
||||||
from collections import namedtuple
|
from collections import namedtuple
|
||||||
|
|
||||||
# Salt testing libs
|
# Salt testing libs
|
||||||
from tests.support.unit import skipIf, TestCase
|
from tests.support.unit import TestCase
|
||||||
from tests.support.mock import NO_MOCK, NO_MOCK_REASON, patch, MagicMock
|
from tests.support.mock import patch, MagicMock
|
||||||
from tests.support.mixins import LoaderModuleMockMixin
|
from tests.support.mixins import LoaderModuleMockMixin
|
||||||
|
|
||||||
# Salt libs
|
# Salt libs
|
||||||
|
@ -18,7 +18,6 @@ STUB_MEMORY_USAGE = namedtuple('vmem', 'total available percent used free active
|
||||||
1156378624, 4750528512, 898908160)
|
1156378624, 4750528512, 898908160)
|
||||||
|
|
||||||
|
|
||||||
@skipIf(NO_MOCK, NO_MOCK_REASON)
|
|
||||||
class MemUsageBeaconTestCase(TestCase, LoaderModuleMockMixin):
|
class MemUsageBeaconTestCase(TestCase, LoaderModuleMockMixin):
|
||||||
'''
|
'''
|
||||||
Test case for salt.beacons.memusage
|
Test case for salt.beacons.memusage
|
||||||
|
|
|
@ -5,8 +5,8 @@ from __future__ import absolute_import
|
||||||
from collections import namedtuple
|
from collections import namedtuple
|
||||||
|
|
||||||
# Salt testing libs
|
# Salt testing libs
|
||||||
from tests.support.unit import skipIf, TestCase
|
from tests.support.unit import TestCase
|
||||||
from tests.support.mock import NO_MOCK, NO_MOCK_REASON, patch, MagicMock
|
from tests.support.mock import patch, MagicMock
|
||||||
from tests.support.mixins import LoaderModuleMockMixin
|
from tests.support.mixins import LoaderModuleMockMixin
|
||||||
|
|
||||||
# Salt libs
|
# Salt libs
|
||||||
|
@ -25,7 +25,6 @@ STUB_NET_IO_COUNTERS = {'eth0': namedtuple('snetio',
|
||||||
0, 0, 0)}
|
0, 0, 0)}
|
||||||
|
|
||||||
|
|
||||||
@skipIf(NO_MOCK, NO_MOCK_REASON)
|
|
||||||
class NetworkInfoBeaconTestCase(TestCase, LoaderModuleMockMixin):
|
class NetworkInfoBeaconTestCase(TestCase, LoaderModuleMockMixin):
|
||||||
'''
|
'''
|
||||||
Test case for salt.beacons.network_info
|
Test case for salt.beacons.network_info
|
||||||
|
|
|
@ -5,7 +5,6 @@ from __future__ import absolute_import
|
||||||
|
|
||||||
# Salt testing libs
|
# Salt testing libs
|
||||||
from tests.support.unit import skipIf, TestCase
|
from tests.support.unit import skipIf, TestCase
|
||||||
from tests.support.mock import NO_MOCK, NO_MOCK_REASON
|
|
||||||
from tests.support.mixins import LoaderModuleMockMixin
|
from tests.support.mixins import LoaderModuleMockMixin
|
||||||
try:
|
try:
|
||||||
from pyroute2 import IPDB
|
from pyroute2 import IPDB
|
||||||
|
@ -20,7 +19,6 @@ import logging
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
@skipIf(NO_MOCK, NO_MOCK_REASON)
|
|
||||||
class NetworkSettingsBeaconTestCase(TestCase, LoaderModuleMockMixin):
|
class NetworkSettingsBeaconTestCase(TestCase, LoaderModuleMockMixin):
|
||||||
'''
|
'''
|
||||||
Test case for salt.beacons.network_settings
|
Test case for salt.beacons.network_settings
|
||||||
|
|
|
@ -4,8 +4,8 @@
|
||||||
from __future__ import absolute_import
|
from __future__ import absolute_import
|
||||||
|
|
||||||
# Salt testing libs
|
# Salt testing libs
|
||||||
from tests.support.unit import skipIf, TestCase
|
from tests.support.unit import TestCase
|
||||||
from tests.support.mock import NO_MOCK, NO_MOCK_REASON, patch
|
from tests.support.mock import patch
|
||||||
from tests.support.mixins import LoaderModuleMockMixin
|
from tests.support.mixins import LoaderModuleMockMixin
|
||||||
|
|
||||||
# Salt libs
|
# Salt libs
|
||||||
|
@ -24,7 +24,6 @@ class FakeProcess(object):
|
||||||
return self._name
|
return self._name
|
||||||
|
|
||||||
|
|
||||||
@skipIf(NO_MOCK, NO_MOCK_REASON)
|
|
||||||
class PSBeaconTestCase(TestCase, LoaderModuleMockMixin):
|
class PSBeaconTestCase(TestCase, LoaderModuleMockMixin):
|
||||||
'''
|
'''
|
||||||
Test case for salt.beacons.[s]
|
Test case for salt.beacons.[s]
|
||||||
|
|
|
@ -5,8 +5,8 @@ from __future__ import absolute_import
|
||||||
from collections import namedtuple
|
from collections import namedtuple
|
||||||
|
|
||||||
# Salt testing libs
|
# Salt testing libs
|
||||||
from tests.support.unit import skipIf, TestCase
|
from tests.support.unit import TestCase
|
||||||
from tests.support.mock import NO_MOCK, NO_MOCK_REASON, patch, MagicMock
|
from tests.support.mock import patch, MagicMock
|
||||||
from tests.support.mixins import LoaderModuleMockMixin
|
from tests.support.mixins import LoaderModuleMockMixin
|
||||||
|
|
||||||
# Salt libs
|
# Salt libs
|
||||||
|
@ -17,7 +17,6 @@ PATCH_OPTS = dict(autospec=True, spec_set=True)
|
||||||
FakeProcess = namedtuple('Process', 'cmdline pid')
|
FakeProcess = namedtuple('Process', 'cmdline pid')
|
||||||
|
|
||||||
|
|
||||||
@skipIf(NO_MOCK, NO_MOCK_REASON)
|
|
||||||
class SaltProxyBeaconTestCase(TestCase, LoaderModuleMockMixin):
|
class SaltProxyBeaconTestCase(TestCase, LoaderModuleMockMixin):
|
||||||
'''
|
'''
|
||||||
Test case for salt.beacons.[s]
|
Test case for salt.beacons.[s]
|
||||||
|
|
|
@ -4,15 +4,14 @@
|
||||||
from __future__ import absolute_import
|
from __future__ import absolute_import
|
||||||
|
|
||||||
# Salt testing libs
|
# Salt testing libs
|
||||||
from tests.support.unit import skipIf, TestCase
|
from tests.support.unit import TestCase
|
||||||
from tests.support.mock import NO_MOCK, NO_MOCK_REASON, MagicMock
|
from tests.support.mock import MagicMock
|
||||||
from tests.support.mixins import LoaderModuleMockMixin
|
from tests.support.mixins import LoaderModuleMockMixin
|
||||||
|
|
||||||
# Salt libs
|
# Salt libs
|
||||||
import salt.beacons.sensehat as sensehat
|
import salt.beacons.sensehat as sensehat
|
||||||
|
|
||||||
|
|
||||||
@skipIf(NO_MOCK, NO_MOCK_REASON)
|
|
||||||
class SensehatBeaconTestCase(TestCase, LoaderModuleMockMixin):
|
class SensehatBeaconTestCase(TestCase, LoaderModuleMockMixin):
|
||||||
'''
|
'''
|
||||||
Test case for salt.beacons.[s]
|
Test case for salt.beacons.[s]
|
||||||
|
|
|
@ -5,8 +5,8 @@ from __future__ import absolute_import
|
||||||
from collections import namedtuple
|
from collections import namedtuple
|
||||||
|
|
||||||
# Salt testing libs
|
# Salt testing libs
|
||||||
from tests.support.unit import skipIf, TestCase
|
from tests.support.unit import TestCase
|
||||||
from tests.support.mock import NO_MOCK, NO_MOCK_REASON, patch, MagicMock
|
from tests.support.mock import patch, MagicMock
|
||||||
from tests.support.mixins import LoaderModuleMockMixin
|
from tests.support.mixins import LoaderModuleMockMixin
|
||||||
|
|
||||||
# Salt libs
|
# Salt libs
|
||||||
|
@ -17,7 +17,6 @@ PATCH_OPTS = dict(autospec=True, spec_set=True)
|
||||||
FakeProcess = namedtuple('Process', 'cmdline pid')
|
FakeProcess = namedtuple('Process', 'cmdline pid')
|
||||||
|
|
||||||
|
|
||||||
@skipIf(NO_MOCK, NO_MOCK_REASON)
|
|
||||||
class ServiceBeaconTestCase(TestCase, LoaderModuleMockMixin):
|
class ServiceBeaconTestCase(TestCase, LoaderModuleMockMixin):
|
||||||
'''
|
'''
|
||||||
Test case for salt.beacons.service
|
Test case for salt.beacons.service
|
||||||
|
|
|
@ -4,8 +4,8 @@
|
||||||
from __future__ import absolute_import, print_function, unicode_literals
|
from __future__ import absolute_import, print_function, unicode_literals
|
||||||
|
|
||||||
# Salt testing libs
|
# Salt testing libs
|
||||||
from tests.support.unit import skipIf, TestCase
|
from tests.support.unit import TestCase
|
||||||
from tests.support.mock import NO_MOCK, NO_MOCK_REASON, patch, MagicMock
|
from tests.support.mock import patch, MagicMock
|
||||||
from tests.support.mixins import LoaderModuleMockMixin
|
from tests.support.mixins import LoaderModuleMockMixin
|
||||||
|
|
||||||
# Salt libs
|
# Salt libs
|
||||||
|
@ -45,7 +45,6 @@ MOCK_IMAGE_TWO = {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@skipIf(NO_MOCK, NO_MOCK_REASON)
|
|
||||||
class SmartOSImgAdmBeaconTestCase(TestCase, LoaderModuleMockMixin):
|
class SmartOSImgAdmBeaconTestCase(TestCase, LoaderModuleMockMixin):
|
||||||
'''
|
'''
|
||||||
Test case for salt.beacons.imgadm
|
Test case for salt.beacons.imgadm
|
||||||
|
|
|
@ -4,8 +4,8 @@
|
||||||
from __future__ import absolute_import
|
from __future__ import absolute_import
|
||||||
|
|
||||||
# Salt testing libs
|
# Salt testing libs
|
||||||
from tests.support.unit import skipIf, TestCase
|
from tests.support.unit import TestCase
|
||||||
from tests.support.mock import NO_MOCK, NO_MOCK_REASON, patch, MagicMock
|
from tests.support.mock import patch, MagicMock
|
||||||
from tests.support.mixins import LoaderModuleMockMixin
|
from tests.support.mixins import LoaderModuleMockMixin
|
||||||
|
|
||||||
# Salt libs
|
# Salt libs
|
||||||
|
@ -52,7 +52,6 @@ MOCK_VM_TWO_STARTED = {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@skipIf(NO_MOCK, NO_MOCK_REASON)
|
|
||||||
class SmartOSImgAdmBeaconTestCase(TestCase, LoaderModuleMockMixin):
|
class SmartOSImgAdmBeaconTestCase(TestCase, LoaderModuleMockMixin):
|
||||||
'''
|
'''
|
||||||
Test case for salt.beacons.vmadm
|
Test case for salt.beacons.vmadm
|
||||||
|
|
|
@ -10,7 +10,7 @@ from salt.beacons import telegram_bot_msg
|
||||||
# Salt testing libs
|
# Salt testing libs
|
||||||
from tests.support.mixins import LoaderModuleMockMixin
|
from tests.support.mixins import LoaderModuleMockMixin
|
||||||
from tests.support.unit import TestCase, skipIf
|
from tests.support.unit import TestCase, skipIf
|
||||||
from tests.support.mock import NO_MOCK, NO_MOCK_REASON, MagicMock, patch
|
from tests.support.mock import MagicMock, patch
|
||||||
|
|
||||||
# Third-party libs
|
# Third-party libs
|
||||||
try:
|
try:
|
||||||
|
@ -24,7 +24,6 @@ log = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
@skipIf(not HAS_TELEGRAM, 'telegram is not available')
|
@skipIf(not HAS_TELEGRAM, 'telegram is not available')
|
||||||
@skipIf(NO_MOCK, NO_MOCK_REASON)
|
|
||||||
class TelegramBotMsgBeaconTestCase(TestCase, LoaderModuleMockMixin):
|
class TelegramBotMsgBeaconTestCase(TestCase, LoaderModuleMockMixin):
|
||||||
'''
|
'''
|
||||||
Test case for salt.beacons.telegram_bot
|
Test case for salt.beacons.telegram_bot
|
||||||
|
|
|
@ -9,7 +9,7 @@ from salt.beacons import twilio_txt_msg
|
||||||
# Salt testing libs
|
# Salt testing libs
|
||||||
from tests.support.mixins import LoaderModuleMockMixin
|
from tests.support.mixins import LoaderModuleMockMixin
|
||||||
from tests.support.unit import TestCase, skipIf
|
from tests.support.unit import TestCase, skipIf
|
||||||
from tests.support.mock import NO_MOCK, NO_MOCK_REASON, MagicMock, patch
|
from tests.support.mock import MagicMock, patch
|
||||||
|
|
||||||
# Import 3rd Party libs
|
# Import 3rd Party libs
|
||||||
try:
|
try:
|
||||||
|
@ -104,7 +104,6 @@ class MockTwilioRestClient(object):
|
||||||
|
|
||||||
|
|
||||||
@skipIf(not HAS_TWILIO, 'twilio.rest is not available')
|
@skipIf(not HAS_TWILIO, 'twilio.rest is not available')
|
||||||
@skipIf(NO_MOCK, NO_MOCK_REASON)
|
|
||||||
class TwilioMsgTxtBeaconTestCase(TestCase, LoaderModuleMockMixin):
|
class TwilioMsgTxtBeaconTestCase(TestCase, LoaderModuleMockMixin):
|
||||||
'''
|
'''
|
||||||
Test case for salt.beacons.twilio_txt_msg
|
Test case for salt.beacons.twilio_txt_msg
|
||||||
|
|
|
@ -7,7 +7,7 @@ import logging
|
||||||
|
|
||||||
# Salt testing libs
|
# Salt testing libs
|
||||||
from tests.support.unit import skipIf, TestCase
|
from tests.support.unit import skipIf, TestCase
|
||||||
from tests.support.mock import NO_MOCK, NO_MOCK_REASON, patch, MagicMock, mock_open
|
from tests.support.mock import patch, MagicMock, mock_open
|
||||||
from tests.support.mixins import LoaderModuleMockMixin
|
from tests.support.mixins import LoaderModuleMockMixin
|
||||||
|
|
||||||
# Salt libs
|
# Salt libs
|
||||||
|
@ -27,7 +27,6 @@ pack = (7, 6216, b'pts/14\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
@skipIf(NO_MOCK, NO_MOCK_REASON)
|
|
||||||
class WTMPBeaconTestCase(TestCase, LoaderModuleMockMixin):
|
class WTMPBeaconTestCase(TestCase, LoaderModuleMockMixin):
|
||||||
'''
|
'''
|
||||||
Test case for salt.beacons.[s]
|
Test case for salt.beacons.[s]
|
||||||
|
|
9
tests/unit/cache/test_cache.py
vendored
9
tests/unit/cache/test_cache.py
vendored
|
@ -8,12 +8,8 @@ from __future__ import absolute_import, print_function, unicode_literals
|
||||||
|
|
||||||
# Import Salt Testing libs
|
# Import Salt Testing libs
|
||||||
# import integration
|
# import integration
|
||||||
from tests.support.unit import skipIf, TestCase
|
from tests.support.unit import TestCase
|
||||||
from tests.support.mock import (
|
from tests.support.mock import patch
|
||||||
NO_MOCK,
|
|
||||||
NO_MOCK_REASON,
|
|
||||||
patch,
|
|
||||||
)
|
|
||||||
|
|
||||||
# Import Salt libs
|
# Import Salt libs
|
||||||
import salt.payload
|
import salt.payload
|
||||||
|
@ -41,7 +37,6 @@ class CacheFunctionsTest(TestCase):
|
||||||
self.assertIsInstance(ret, salt.cache.MemCache)
|
self.assertIsInstance(ret, salt.cache.MemCache)
|
||||||
|
|
||||||
|
|
||||||
@skipIf(NO_MOCK, NO_MOCK_REASON)
|
|
||||||
class MemCacheTest(TestCase):
|
class MemCacheTest(TestCase):
|
||||||
'''
|
'''
|
||||||
Validate Cache class methods
|
Validate Cache class methods
|
||||||
|
|
5
tests/unit/cache/test_localfs.py
vendored
5
tests/unit/cache/test_localfs.py
vendored
|
@ -12,11 +12,9 @@ import tempfile
|
||||||
# Import Salt Testing libs
|
# Import Salt Testing libs
|
||||||
from tests.support.runtests import RUNTIME_VARS
|
from tests.support.runtests import RUNTIME_VARS
|
||||||
from tests.support.mixins import LoaderModuleMockMixin
|
from tests.support.mixins import LoaderModuleMockMixin
|
||||||
from tests.support.unit import skipIf, TestCase
|
from tests.support.unit import TestCase
|
||||||
from tests.support.mock import (
|
from tests.support.mock import (
|
||||||
MagicMock,
|
MagicMock,
|
||||||
NO_MOCK,
|
|
||||||
NO_MOCK_REASON,
|
|
||||||
patch
|
patch
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -27,7 +25,6 @@ import salt.cache.localfs as localfs
|
||||||
from salt.exceptions import SaltCacheError
|
from salt.exceptions import SaltCacheError
|
||||||
|
|
||||||
|
|
||||||
@skipIf(NO_MOCK, NO_MOCK_REASON)
|
|
||||||
class LocalFSTest(TestCase, LoaderModuleMockMixin):
|
class LocalFSTest(TestCase, LoaderModuleMockMixin):
|
||||||
'''
|
'''
|
||||||
Validate the functions in the localfs cache
|
Validate the functions in the localfs cache
|
||||||
|
|
|
@ -10,11 +10,10 @@ from __future__ import absolute_import, print_function, unicode_literals
|
||||||
from salt.cli.batch import Batch
|
from salt.cli.batch import Batch
|
||||||
|
|
||||||
# Import Salt Testing Libs
|
# Import Salt Testing Libs
|
||||||
from tests.support.unit import skipIf, TestCase
|
from tests.support.unit import TestCase
|
||||||
from tests.support.mock import MagicMock, patch, NO_MOCK, NO_MOCK_REASON
|
from tests.support.mock import MagicMock, patch
|
||||||
|
|
||||||
|
|
||||||
@skipIf(NO_MOCK, NO_MOCK_REASON)
|
|
||||||
class BatchTestCase(TestCase):
|
class BatchTestCase(TestCase):
|
||||||
'''
|
'''
|
||||||
Unit Tests for the salt.cli.batch module
|
Unit Tests for the salt.cli.batch module
|
||||||
|
|
|
@ -9,8 +9,8 @@ import logging
|
||||||
import multiprocessing
|
import multiprocessing
|
||||||
|
|
||||||
# Import Salt Testing libs
|
# Import Salt Testing libs
|
||||||
from tests.support.unit import TestCase, skipIf
|
from tests.support.unit import TestCase
|
||||||
from tests.support.mock import patch, MagicMock, NO_MOCK, NO_MOCK_REASON
|
from tests.support.mock import patch, MagicMock
|
||||||
from tests.support.mixins import SaltClientTestCaseMixin
|
from tests.support.mixins import SaltClientTestCaseMixin
|
||||||
|
|
||||||
# Import Salt libs
|
# Import Salt libs
|
||||||
|
@ -223,7 +223,6 @@ def _syndic_exec_test(child_pipe):
|
||||||
child_pipe.close()
|
child_pipe.close()
|
||||||
|
|
||||||
|
|
||||||
@skipIf(NO_MOCK, NO_MOCK_REASON)
|
|
||||||
class DaemonsStarterTestCase(TestCase, SaltClientTestCaseMixin):
|
class DaemonsStarterTestCase(TestCase, SaltClientTestCaseMixin):
|
||||||
'''
|
'''
|
||||||
Unit test for the daemons starter classes.
|
Unit test for the daemons starter classes.
|
||||||
|
|
|
@ -13,7 +13,7 @@ import tempfile
|
||||||
from tests.support.runtests import RUNTIME_VARS
|
from tests.support.runtests import RUNTIME_VARS
|
||||||
from tests.support.unit import skipIf, TestCase
|
from tests.support.unit import skipIf, TestCase
|
||||||
from tests.support.case import ShellCase
|
from tests.support.case import ShellCase
|
||||||
from tests.support.mock import NO_MOCK, NO_MOCK_REASON, patch, MagicMock
|
from tests.support.mock import patch, MagicMock
|
||||||
|
|
||||||
# Import Salt libs
|
# Import Salt libs
|
||||||
import salt.config
|
import salt.config
|
||||||
|
@ -35,7 +35,6 @@ self:
|
||||||
'''
|
'''
|
||||||
|
|
||||||
|
|
||||||
@skipIf(NO_MOCK, NO_MOCK_REASON)
|
|
||||||
@skipIf(not salt.utils.path.which('ssh'), "No ssh binary found in path")
|
@skipIf(not salt.utils.path.which('ssh'), "No ssh binary found in path")
|
||||||
class SSHPasswordTests(ShellCase):
|
class SSHPasswordTests(ShellCase):
|
||||||
def test_password_failure(self):
|
def test_password_failure(self):
|
||||||
|
@ -105,7 +104,6 @@ class SSHRosterDefaults(TestCase):
|
||||||
shutil.rmtree(tempdir)
|
shutil.rmtree(tempdir)
|
||||||
|
|
||||||
|
|
||||||
@skipIf(NO_MOCK, NO_MOCK_REASON)
|
|
||||||
class SSHSingleTests(TestCase):
|
class SSHSingleTests(TestCase):
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
self.tmp_cachedir = tempfile.mkdtemp(dir=RUNTIME_VARS.TMP)
|
self.tmp_cachedir = tempfile.mkdtemp(dir=RUNTIME_VARS.TMP)
|
||||||
|
|
|
@ -23,7 +23,7 @@ from salt.utils.versions import LooseVersion
|
||||||
# Import Salt Testing Libs
|
# Import Salt Testing Libs
|
||||||
from tests.support.mixins import LoaderModuleMockMixin
|
from tests.support.mixins import LoaderModuleMockMixin
|
||||||
from tests.support.unit import TestCase, skipIf
|
from tests.support.unit import TestCase, skipIf
|
||||||
from tests.support.mock import MagicMock, NO_MOCK, NO_MOCK_REASON, patch, __version__ as mock_version
|
from tests.support.mock import MagicMock, patch, __version__ as mock_version
|
||||||
from tests.unit.cloud.clouds import _preferred_ip
|
from tests.unit.cloud.clouds import _preferred_ip
|
||||||
|
|
||||||
VM_NAME = 'winterfell'
|
VM_NAME = 'winterfell'
|
||||||
|
@ -57,7 +57,6 @@ class ExtendedTestCase(TestCase):
|
||||||
self.assertEqual(exc.message, exc_msg)
|
self.assertEqual(exc.message, exc_msg)
|
||||||
|
|
||||||
|
|
||||||
@skipIf(NO_MOCK, NO_MOCK_REASON)
|
|
||||||
class DimensionDataTestCase(ExtendedTestCase, LoaderModuleMockMixin):
|
class DimensionDataTestCase(ExtendedTestCase, LoaderModuleMockMixin):
|
||||||
'''
|
'''
|
||||||
Unit TestCase for salt.cloud.clouds.dimensiondata module.
|
Unit TestCase for salt.cloud.clouds.dimensiondata module.
|
||||||
|
|
|
@ -14,7 +14,7 @@ import salt.utils.files
|
||||||
from tests.support.runtests import RUNTIME_VARS
|
from tests.support.runtests import RUNTIME_VARS
|
||||||
from tests.support.unit import TestCase, skipIf
|
from tests.support.unit import TestCase, skipIf
|
||||||
from tests.support.mixins import LoaderModuleMockMixin
|
from tests.support.mixins import LoaderModuleMockMixin
|
||||||
from tests.support.mock import NO_MOCK, NO_MOCK_REASON, patch, PropertyMock
|
from tests.support.mock import patch, PropertyMock
|
||||||
from tests.unit.test_crypt import PRIVKEY_DATA
|
from tests.unit.test_crypt import PRIVKEY_DATA
|
||||||
|
|
||||||
PASS_DATA = (
|
PASS_DATA = (
|
||||||
|
@ -26,7 +26,6 @@ PASS_DATA = (
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@skipIf(NO_MOCK, NO_MOCK_REASON)
|
|
||||||
class EC2TestCase(TestCase, LoaderModuleMockMixin):
|
class EC2TestCase(TestCase, LoaderModuleMockMixin):
|
||||||
'''
|
'''
|
||||||
Unit TestCase for salt.cloud.clouds.ec2 module.
|
Unit TestCase for salt.cloud.clouds.ec2 module.
|
||||||
|
|
|
@ -22,8 +22,8 @@ from salt.utils.versions import LooseVersion
|
||||||
|
|
||||||
# Import Salt Testing Libs
|
# Import Salt Testing Libs
|
||||||
from tests.support.mixins import LoaderModuleMockMixin
|
from tests.support.mixins import LoaderModuleMockMixin
|
||||||
from tests.support.unit import TestCase, skipIf
|
from tests.support.unit import TestCase
|
||||||
from tests.support.mock import NO_MOCK, NO_MOCK_REASON, patch, __version__ as mock_version
|
from tests.support.mock import patch, __version__ as mock_version
|
||||||
|
|
||||||
VM_NAME = 'kings_landing'
|
VM_NAME = 'kings_landing'
|
||||||
DUMMY_TOKEN = {
|
DUMMY_TOKEN = {
|
||||||
|
@ -48,7 +48,6 @@ except ImportError:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
@skipIf(NO_MOCK, NO_MOCK_REASON)
|
|
||||||
class GCETestCase(TestCase, LoaderModuleMockMixin):
|
class GCETestCase(TestCase, LoaderModuleMockMixin):
|
||||||
'''
|
'''
|
||||||
Unit TestCase for salt.cloud.clouds.gce module.
|
Unit TestCase for salt.cloud.clouds.gce module.
|
||||||
|
|
|
@ -12,8 +12,6 @@ from tests.support.unit import TestCase, skipIf
|
||||||
from tests.support.mock import (
|
from tests.support.mock import (
|
||||||
MagicMock,
|
MagicMock,
|
||||||
patch,
|
patch,
|
||||||
NO_MOCK,
|
|
||||||
NO_MOCK_REASON
|
|
||||||
)
|
)
|
||||||
|
|
||||||
# Import Salt Libs
|
# Import Salt Libs
|
||||||
|
@ -34,7 +32,6 @@ def fake_wait_for_ip(check_for_ip_fn,
|
||||||
return check_for_ip_fn()
|
return check_for_ip_fn()
|
||||||
|
|
||||||
|
|
||||||
@skipIf(NO_MOCK, NO_MOCK_REASON)
|
|
||||||
@skipIf(joyent.HAS_REQUIRED_CRYPTO is False, reason='PyCrypto or Cryptodome not installed')
|
@skipIf(joyent.HAS_REQUIRED_CRYPTO is False, reason='PyCrypto or Cryptodome not installed')
|
||||||
class JoyentTestCase(TestCase, LoaderModuleMockMixin):
|
class JoyentTestCase(TestCase, LoaderModuleMockMixin):
|
||||||
'''
|
'''
|
||||||
|
|
|
@ -8,14 +8,12 @@ from __future__ import absolute_import, print_function, unicode_literals
|
||||||
|
|
||||||
# Import Salt Testing Libs
|
# Import Salt Testing Libs
|
||||||
from tests.support.mixins import LoaderModuleMockMixin
|
from tests.support.mixins import LoaderModuleMockMixin
|
||||||
from tests.support.unit import TestCase, skipIf
|
from tests.support.unit import TestCase
|
||||||
from tests.support.mock import NO_MOCK, NO_MOCK_REASON
|
|
||||||
|
|
||||||
# Import Salt Libs
|
# Import Salt Libs
|
||||||
from salt.cloud.clouds import linode
|
from salt.cloud.clouds import linode
|
||||||
|
|
||||||
|
|
||||||
@skipIf(NO_MOCK, NO_MOCK_REASON)
|
|
||||||
class LinodeTestCase(TestCase, LoaderModuleMockMixin):
|
class LinodeTestCase(TestCase, LoaderModuleMockMixin):
|
||||||
'''
|
'''
|
||||||
Unit TestCase for the salt.cloud.clouds.linode module.
|
Unit TestCase for the salt.cloud.clouds.linode module.
|
||||||
|
|
|
@ -9,7 +9,7 @@ from __future__ import absolute_import, print_function, unicode_literals
|
||||||
# Import Salt Testing Libs
|
# Import Salt Testing Libs
|
||||||
from tests.support.mixins import LoaderModuleMockMixin
|
from tests.support.mixins import LoaderModuleMockMixin
|
||||||
from tests.support.unit import TestCase, skipIf
|
from tests.support.unit import TestCase, skipIf
|
||||||
from tests.support.mock import MagicMock, NO_MOCK, NO_MOCK_REASON, patch
|
from tests.support.mock import MagicMock, patch
|
||||||
|
|
||||||
# Import Salt Libs
|
# Import Salt Libs
|
||||||
from salt.cloud.clouds import opennebula
|
from salt.cloud.clouds import opennebula
|
||||||
|
@ -25,7 +25,6 @@ except ImportError:
|
||||||
VM_NAME = 'my-vm'
|
VM_NAME = 'my-vm'
|
||||||
|
|
||||||
|
|
||||||
@skipIf(NO_MOCK, NO_MOCK_REASON)
|
|
||||||
class OpenNebulaTestCase(TestCase, LoaderModuleMockMixin):
|
class OpenNebulaTestCase(TestCase, LoaderModuleMockMixin):
|
||||||
'''
|
'''
|
||||||
Unit TestCase for salt.cloud.clouds.opennebula module.
|
Unit TestCase for salt.cloud.clouds.opennebula module.
|
||||||
|
|
|
@ -14,8 +14,8 @@ from salt.cloud.clouds import openstack
|
||||||
|
|
||||||
# Import Salt Testing Libs
|
# Import Salt Testing Libs
|
||||||
from tests.support.mixins import LoaderModuleMockMixin
|
from tests.support.mixins import LoaderModuleMockMixin
|
||||||
from tests.support.unit import TestCase, skipIf
|
from tests.support.unit import TestCase
|
||||||
from tests.support.mock import NO_MOCK, NO_MOCK_REASON, patch
|
from tests.support.mock import patch
|
||||||
|
|
||||||
|
|
||||||
class MockImage(object):
|
class MockImage(object):
|
||||||
|
@ -53,7 +53,6 @@ class MockConn(object):
|
||||||
return [self.node]
|
return [self.node]
|
||||||
|
|
||||||
|
|
||||||
@skipIf(NO_MOCK, NO_MOCK_REASON)
|
|
||||||
class OpenstackTestCase(TestCase, LoaderModuleMockMixin):
|
class OpenstackTestCase(TestCase, LoaderModuleMockMixin):
|
||||||
'''
|
'''
|
||||||
Unit TestCase for salt.cloud.clouds.openstack module.
|
Unit TestCase for salt.cloud.clouds.openstack module.
|
||||||
|
|
|
@ -8,8 +8,8 @@ from __future__ import absolute_import, print_function, unicode_literals
|
||||||
|
|
||||||
# Import Salt Testing Libs
|
# Import Salt Testing Libs
|
||||||
from tests.support.mixins import LoaderModuleMockMixin
|
from tests.support.mixins import LoaderModuleMockMixin
|
||||||
from tests.support.unit import skipIf, TestCase
|
from tests.support.unit import TestCase
|
||||||
from tests.support.mock import MagicMock, NO_MOCK, NO_MOCK_REASON, patch, ANY
|
from tests.support.mock import MagicMock, patch, ANY
|
||||||
|
|
||||||
|
|
||||||
# Import Salt Libs
|
# Import Salt Libs
|
||||||
|
@ -32,7 +32,6 @@ TEST_PROFILES = {
|
||||||
TEST_PROFILE_NAMES = ['testprofile1', 'testprofile2', 'testprofile3']
|
TEST_PROFILE_NAMES = ['testprofile1', 'testprofile2', 'testprofile3']
|
||||||
|
|
||||||
|
|
||||||
@skipIf(NO_MOCK, NO_MOCK_REASON)
|
|
||||||
class SaltifyTestCase(TestCase, LoaderModuleMockMixin):
|
class SaltifyTestCase(TestCase, LoaderModuleMockMixin):
|
||||||
'''
|
'''
|
||||||
Test cases for salt.cloud.clouds.saltify
|
Test cases for salt.cloud.clouds.saltify
|
||||||
|
|
|
@ -13,7 +13,7 @@ from copy import deepcopy
|
||||||
# Import Salt Testing Libs
|
# Import Salt Testing Libs
|
||||||
from tests.support.mixins import LoaderModuleMockMixin
|
from tests.support.mixins import LoaderModuleMockMixin
|
||||||
from tests.support.unit import TestCase, skipIf
|
from tests.support.unit import TestCase, skipIf
|
||||||
from tests.support.mock import MagicMock, NO_MOCK, NO_MOCK_REASON, patch
|
from tests.support.mock import MagicMock, patch
|
||||||
|
|
||||||
# Import Salt Libs
|
# Import Salt Libs
|
||||||
from salt import config
|
from salt import config
|
||||||
|
@ -74,7 +74,6 @@ class ExtendedTestCase(TestCase, LoaderModuleMockMixin):
|
||||||
self.assertEqual(exc.message, exc_msg)
|
self.assertEqual(exc.message, exc_msg)
|
||||||
|
|
||||||
|
|
||||||
@skipIf(NO_MOCK, NO_MOCK_REASON)
|
|
||||||
@skipIf(not HAS_LIBS, 'Install pyVmomi to be able to run this test.')
|
@skipIf(not HAS_LIBS, 'Install pyVmomi to be able to run this test.')
|
||||||
class VMwareTestCase(ExtendedTestCase):
|
class VMwareTestCase(ExtendedTestCase):
|
||||||
'''
|
'''
|
||||||
|
|
|
@ -14,12 +14,10 @@ import salt.utils.platform
|
||||||
|
|
||||||
# Import Salt Testing Libs
|
# Import Salt Testing Libs
|
||||||
from tests.support.runtests import RUNTIME_VARS
|
from tests.support.runtests import RUNTIME_VARS
|
||||||
from tests.support.unit import TestCase, skipIf
|
from tests.support.unit import TestCase
|
||||||
from tests.support.mock import (
|
from tests.support.mock import (
|
||||||
patch,
|
patch,
|
||||||
MagicMock,
|
MagicMock,
|
||||||
NO_MOCK,
|
|
||||||
NO_MOCK_REASON
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@ -59,7 +57,6 @@ def patch_check_permissions(uid=1, groups=None, is_windows=False, permissive_pki
|
||||||
return decorator
|
return decorator
|
||||||
|
|
||||||
|
|
||||||
@skipIf(NO_MOCK, NO_MOCK_REASON)
|
|
||||||
class AutoKeyTest(TestCase):
|
class AutoKeyTest(TestCase):
|
||||||
'''
|
'''
|
||||||
Tests for the salt.daemons.masterapi.AutoKey class
|
Tests for the salt.daemons.masterapi.AutoKey class
|
||||||
|
@ -241,7 +238,6 @@ class AutoKeyTest(TestCase):
|
||||||
self._test_check_autosign_grains(test_func, file_content=file_content, permissions_ret=False)
|
self._test_check_autosign_grains(test_func, file_content=file_content, permissions_ret=False)
|
||||||
|
|
||||||
|
|
||||||
@skipIf(NO_MOCK, NO_MOCK_REASON)
|
|
||||||
class LocalFuncsTestCase(TestCase):
|
class LocalFuncsTestCase(TestCase):
|
||||||
'''
|
'''
|
||||||
TestCase for salt.daemons.masterapi.LocalFuncs class
|
TestCase for salt.daemons.masterapi.LocalFuncs class
|
||||||
|
|
|
@ -7,10 +7,8 @@ from __future__ import absolute_import, print_function, unicode_literals
|
||||||
|
|
||||||
# Import Salt Testing Libs
|
# Import Salt Testing Libs
|
||||||
from tests.support.mixins import LoaderModuleMockMixin
|
from tests.support.mixins import LoaderModuleMockMixin
|
||||||
from tests.support.unit import skipIf, TestCase
|
from tests.support.unit import TestCase
|
||||||
from tests.support.mock import (
|
from tests.support.mock import (
|
||||||
NO_MOCK,
|
|
||||||
NO_MOCK_REASON,
|
|
||||||
MagicMock,
|
MagicMock,
|
||||||
patch)
|
patch)
|
||||||
|
|
||||||
|
@ -21,7 +19,6 @@ import salt.engines.libvirt_events as libvirt_events
|
||||||
# pylint: disable=protected-access,attribute-defined-outside-init,invalid-name,unused-argument,no-self-use
|
# pylint: disable=protected-access,attribute-defined-outside-init,invalid-name,unused-argument,no-self-use
|
||||||
|
|
||||||
|
|
||||||
@skipIf(NO_MOCK, NO_MOCK_REASON)
|
|
||||||
class EngineLibvirtEventTestCase(TestCase, LoaderModuleMockMixin):
|
class EngineLibvirtEventTestCase(TestCase, LoaderModuleMockMixin):
|
||||||
'''
|
'''
|
||||||
Test cases for salt.engine.libvirt_events
|
Test cases for salt.engine.libvirt_events
|
||||||
|
|
|
@ -9,8 +9,6 @@ from __future__ import absolute_import, print_function, unicode_literals
|
||||||
from tests.support.mixins import LoaderModuleMockMixin
|
from tests.support.mixins import LoaderModuleMockMixin
|
||||||
from tests.support.unit import skipIf, TestCase
|
from tests.support.unit import skipIf, TestCase
|
||||||
from tests.support.mock import (
|
from tests.support.mock import (
|
||||||
NO_MOCK,
|
|
||||||
NO_MOCK_REASON,
|
|
||||||
MagicMock,
|
MagicMock,
|
||||||
patch)
|
patch)
|
||||||
|
|
||||||
|
@ -20,7 +18,6 @@ import salt.config
|
||||||
|
|
||||||
|
|
||||||
@skipIf(slack.HAS_SLACKCLIENT is False, 'The SlackClient is not installed')
|
@skipIf(slack.HAS_SLACKCLIENT is False, 'The SlackClient is not installed')
|
||||||
@skipIf(NO_MOCK, NO_MOCK_REASON)
|
|
||||||
class EngineSlackTestCase(TestCase, LoaderModuleMockMixin):
|
class EngineSlackTestCase(TestCase, LoaderModuleMockMixin):
|
||||||
'''
|
'''
|
||||||
Test cases for salt.engine.sqs_events
|
Test cases for salt.engine.sqs_events
|
||||||
|
|
|
@ -9,8 +9,6 @@ from __future__ import absolute_import, print_function, unicode_literals
|
||||||
from tests.support.mixins import LoaderModuleMockMixin
|
from tests.support.mixins import LoaderModuleMockMixin
|
||||||
from tests.support.unit import skipIf, TestCase
|
from tests.support.unit import skipIf, TestCase
|
||||||
from tests.support.mock import (
|
from tests.support.mock import (
|
||||||
NO_MOCK,
|
|
||||||
NO_MOCK_REASON,
|
|
||||||
MagicMock,
|
MagicMock,
|
||||||
patch)
|
patch)
|
||||||
|
|
||||||
|
@ -19,7 +17,6 @@ import salt.engines.sqs_events as sqs_events
|
||||||
|
|
||||||
|
|
||||||
@skipIf(sqs_events.HAS_BOTO is False, 'The boto library is not installed')
|
@skipIf(sqs_events.HAS_BOTO is False, 'The boto library is not installed')
|
||||||
@skipIf(NO_MOCK, NO_MOCK_REASON)
|
|
||||||
class EngineSqsEventTestCase(TestCase, LoaderModuleMockMixin):
|
class EngineSqsEventTestCase(TestCase, LoaderModuleMockMixin):
|
||||||
'''
|
'''
|
||||||
Test cases for salt.engine.sqs_events
|
Test cases for salt.engine.sqs_events
|
||||||
|
|
|
@ -22,7 +22,7 @@ except ImportError:
|
||||||
from tests.support.runtests import RUNTIME_VARS
|
from tests.support.runtests import RUNTIME_VARS
|
||||||
from tests.support.mixins import LoaderModuleMockMixin
|
from tests.support.mixins import LoaderModuleMockMixin
|
||||||
from tests.support.unit import TestCase, skipIf
|
from tests.support.unit import TestCase, skipIf
|
||||||
from tests.support.mock import NO_MOCK, NO_MOCK_REASON, patch
|
from tests.support.mock import patch
|
||||||
from tests.support.helpers import patched_environ
|
from tests.support.helpers import patched_environ
|
||||||
|
|
||||||
# Import salt libs
|
# Import salt libs
|
||||||
|
@ -475,7 +475,6 @@ class GitFSTestBase(object):
|
||||||
|
|
||||||
|
|
||||||
@skipIf(not HAS_GITPYTHON, 'GitPython >= {0} required'.format(GITPYTHON_MINVER))
|
@skipIf(not HAS_GITPYTHON, 'GitPython >= {0} required'.format(GITPYTHON_MINVER))
|
||||||
@skipIf(NO_MOCK, NO_MOCK_REASON)
|
|
||||||
class GitPythonTest(GitFSTestBase, GitFSTestFuncs, TestCase, LoaderModuleMockMixin):
|
class GitPythonTest(GitFSTestBase, GitFSTestFuncs, TestCase, LoaderModuleMockMixin):
|
||||||
|
|
||||||
def setup_loader_modules(self):
|
def setup_loader_modules(self):
|
||||||
|
@ -522,7 +521,6 @@ class GitPythonTest(GitFSTestBase, GitFSTestFuncs, TestCase, LoaderModuleMockMix
|
||||||
@skipIf(not HAS_GITPYTHON, 'GitPython >= {0} required for temp repo setup'.format(GITPYTHON_MINVER))
|
@skipIf(not HAS_GITPYTHON, 'GitPython >= {0} required for temp repo setup'.format(GITPYTHON_MINVER))
|
||||||
@skipIf(not HAS_PYGIT2, 'pygit2 >= {0} and libgit2 >= {1} required'.format(PYGIT2_MINVER, LIBGIT2_MINVER))
|
@skipIf(not HAS_PYGIT2, 'pygit2 >= {0} and libgit2 >= {1} required'.format(PYGIT2_MINVER, LIBGIT2_MINVER))
|
||||||
@skipIf(salt.utils.platform.is_windows(), 'Skip Pygit2 on windows, due to pygit2 access error on windows')
|
@skipIf(salt.utils.platform.is_windows(), 'Skip Pygit2 on windows, due to pygit2 access error on windows')
|
||||||
@skipIf(NO_MOCK, NO_MOCK_REASON)
|
|
||||||
class Pygit2Test(GitFSTestBase, GitFSTestFuncs, TestCase, LoaderModuleMockMixin):
|
class Pygit2Test(GitFSTestBase, GitFSTestFuncs, TestCase, LoaderModuleMockMixin):
|
||||||
|
|
||||||
def setup_loader_modules(self):
|
def setup_loader_modules(self):
|
||||||
|
|
|
@ -11,8 +11,8 @@ import tempfile
|
||||||
|
|
||||||
# Import Salt Testing libs
|
# Import Salt Testing libs
|
||||||
from tests.support.mixins import AdaptedConfigurationTestCaseMixin, LoaderModuleMockMixin
|
from tests.support.mixins import AdaptedConfigurationTestCaseMixin, LoaderModuleMockMixin
|
||||||
from tests.support.unit import TestCase, skipIf
|
from tests.support.unit import TestCase
|
||||||
from tests.support.mock import patch, NO_MOCK, NO_MOCK_REASON
|
from tests.support.mock import patch
|
||||||
from tests.support.runtests import RUNTIME_VARS
|
from tests.support.runtests import RUNTIME_VARS
|
||||||
|
|
||||||
# Import Salt libs
|
# Import Salt libs
|
||||||
|
@ -31,7 +31,6 @@ UNICODE_FILENAME = 'питон.txt'
|
||||||
UNICODE_DIRNAME = UNICODE_ENVNAME = 'соль'
|
UNICODE_DIRNAME = UNICODE_ENVNAME = 'соль'
|
||||||
|
|
||||||
|
|
||||||
@skipIf(NO_MOCK, NO_MOCK_REASON)
|
|
||||||
class RootsTest(TestCase, AdaptedConfigurationTestCaseMixin, LoaderModuleMockMixin):
|
class RootsTest(TestCase, AdaptedConfigurationTestCaseMixin, LoaderModuleMockMixin):
|
||||||
|
|
||||||
def setup_loader_modules(self):
|
def setup_loader_modules(self):
|
||||||
|
|
|
@ -24,8 +24,6 @@ from tests.support.mock import (
|
||||||
MagicMock,
|
MagicMock,
|
||||||
patch,
|
patch,
|
||||||
mock_open,
|
mock_open,
|
||||||
NO_MOCK,
|
|
||||||
NO_MOCK_REASON
|
|
||||||
)
|
)
|
||||||
|
|
||||||
# Import Salt Libs
|
# Import Salt Libs
|
||||||
|
@ -58,7 +56,6 @@ OS_RELEASE_DIR = os.path.join(os.path.dirname(__file__), "os-releases")
|
||||||
SOLARIS_DIR = os.path.join(os.path.dirname(__file__), 'solaris')
|
SOLARIS_DIR = os.path.join(os.path.dirname(__file__), 'solaris')
|
||||||
|
|
||||||
|
|
||||||
@skipIf(NO_MOCK, NO_MOCK_REASON)
|
|
||||||
@skipIf(not pytest, False)
|
@skipIf(not pytest, False)
|
||||||
class CoreGrainsTestCase(TestCase, LoaderModuleMockMixin):
|
class CoreGrainsTestCase(TestCase, LoaderModuleMockMixin):
|
||||||
'''
|
'''
|
||||||
|
|
|
@ -8,19 +8,16 @@ import textwrap
|
||||||
|
|
||||||
# Import Salt Testing Libs
|
# Import Salt Testing Libs
|
||||||
from tests.support.mixins import LoaderModuleMockMixin
|
from tests.support.mixins import LoaderModuleMockMixin
|
||||||
from tests.support.unit import TestCase, skipIf
|
from tests.support.unit import TestCase
|
||||||
from tests.support.mock import (
|
from tests.support.mock import (
|
||||||
patch,
|
patch,
|
||||||
MagicMock,
|
MagicMock,
|
||||||
NO_MOCK,
|
|
||||||
NO_MOCK_REASON
|
|
||||||
)
|
)
|
||||||
|
|
||||||
# Import Salt Libs
|
# Import Salt Libs
|
||||||
import salt.grains.disks as disks
|
import salt.grains.disks as disks
|
||||||
|
|
||||||
|
|
||||||
@skipIf(NO_MOCK, NO_MOCK_REASON)
|
|
||||||
class IscsiGrainsTestCase(TestCase, LoaderModuleMockMixin):
|
class IscsiGrainsTestCase(TestCase, LoaderModuleMockMixin):
|
||||||
'''
|
'''
|
||||||
Test cases for _windows_disks grains
|
Test cases for _windows_disks grains
|
||||||
|
|
|
@ -6,20 +6,17 @@
|
||||||
from __future__ import absolute_import, print_function, unicode_literals
|
from __future__ import absolute_import, print_function, unicode_literals
|
||||||
|
|
||||||
# Import Salt Testing Libs
|
# Import Salt Testing Libs
|
||||||
from tests.support.unit import TestCase, skipIf
|
from tests.support.unit import TestCase
|
||||||
from tests.support.mock import (
|
from tests.support.mock import (
|
||||||
patch,
|
patch,
|
||||||
mock_open,
|
mock_open,
|
||||||
MagicMock,
|
MagicMock,
|
||||||
NO_MOCK,
|
|
||||||
NO_MOCK_REASON
|
|
||||||
)
|
)
|
||||||
|
|
||||||
# Import Salt Libs
|
# Import Salt Libs
|
||||||
import salt.grains.fibre_channel as fibre_channel
|
import salt.grains.fibre_channel as fibre_channel
|
||||||
|
|
||||||
|
|
||||||
@skipIf(NO_MOCK, NO_MOCK_REASON)
|
|
||||||
class FibreChannelGrainsTestCase(TestCase):
|
class FibreChannelGrainsTestCase(TestCase):
|
||||||
'''
|
'''
|
||||||
Test cases for iscsi grains
|
Test cases for iscsi grains
|
||||||
|
|
|
@ -8,20 +8,17 @@ import errno
|
||||||
import textwrap
|
import textwrap
|
||||||
|
|
||||||
# Import Salt Testing Libs
|
# Import Salt Testing Libs
|
||||||
from tests.support.unit import TestCase, skipIf
|
from tests.support.unit import TestCase
|
||||||
from tests.support.mock import (
|
from tests.support.mock import (
|
||||||
patch,
|
patch,
|
||||||
mock_open,
|
mock_open,
|
||||||
MagicMock,
|
MagicMock,
|
||||||
NO_MOCK,
|
|
||||||
NO_MOCK_REASON
|
|
||||||
)
|
)
|
||||||
|
|
||||||
# Import Salt Libs
|
# Import Salt Libs
|
||||||
import salt.grains.iscsi as iscsi
|
import salt.grains.iscsi as iscsi
|
||||||
|
|
||||||
|
|
||||||
@skipIf(NO_MOCK, NO_MOCK_REASON)
|
|
||||||
class IscsiGrainsTestCase(TestCase):
|
class IscsiGrainsTestCase(TestCase):
|
||||||
'''
|
'''
|
||||||
Test cases for iscsi grains
|
Test cases for iscsi grains
|
||||||
|
|
|
@ -8,11 +8,9 @@ from __future__ import absolute_import, print_function, unicode_literals
|
||||||
|
|
||||||
# Import Salt Testing Libs
|
# Import Salt Testing Libs
|
||||||
from tests.support.mixins import LoaderModuleMockMixin
|
from tests.support.mixins import LoaderModuleMockMixin
|
||||||
from tests.support.unit import TestCase, skipIf
|
from tests.support.unit import TestCase
|
||||||
from tests.support.mock import (
|
from tests.support.mock import (
|
||||||
MagicMock,
|
MagicMock,
|
||||||
NO_MOCK,
|
|
||||||
NO_MOCK_REASON,
|
|
||||||
patch
|
patch
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -35,7 +33,6 @@ TEST_CACHE = {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@skipIf(NO_MOCK, NO_MOCK_REASON)
|
|
||||||
@patch('salt.grains.napalm.DEVICE_CACHE', TEST_DEVICE_CACHE)
|
@patch('salt.grains.napalm.DEVICE_CACHE', TEST_DEVICE_CACHE)
|
||||||
@patch('salt.grains.napalm.GRAINS_CACHE', TEST_CACHE)
|
@patch('salt.grains.napalm.GRAINS_CACHE', TEST_CACHE)
|
||||||
class NapalmGrainsTestCase(TestCase, LoaderModuleMockMixin):
|
class NapalmGrainsTestCase(TestCase, LoaderModuleMockMixin):
|
||||||
|
|
|
@ -8,20 +8,17 @@ import errno
|
||||||
import textwrap
|
import textwrap
|
||||||
|
|
||||||
# Import Salt Testing Libs
|
# Import Salt Testing Libs
|
||||||
from tests.support.unit import TestCase, skipIf
|
from tests.support.unit import TestCase
|
||||||
from tests.support.mock import (
|
from tests.support.mock import (
|
||||||
patch,
|
patch,
|
||||||
mock_open,
|
mock_open,
|
||||||
MagicMock,
|
MagicMock
|
||||||
NO_MOCK,
|
|
||||||
NO_MOCK_REASON
|
|
||||||
)
|
)
|
||||||
|
|
||||||
# Import Salt Libs
|
# Import Salt Libs
|
||||||
import salt.grains.nvme as nvme
|
import salt.grains.nvme as nvme
|
||||||
|
|
||||||
|
|
||||||
@skipIf(NO_MOCK, NO_MOCK_REASON)
|
|
||||||
class NvmeGrainsTestCase(TestCase):
|
class NvmeGrainsTestCase(TestCase):
|
||||||
'''
|
'''
|
||||||
Test cases for nvme grains
|
Test cases for nvme grains
|
||||||
|
|
|
@ -26,15 +26,12 @@ from tests.support.helpers import no_symlinks
|
||||||
from tests.support.mock import (
|
from tests.support.mock import (
|
||||||
MagicMock,
|
MagicMock,
|
||||||
patch,
|
patch,
|
||||||
NO_MOCK,
|
|
||||||
NO_MOCK_REASON
|
|
||||||
)
|
)
|
||||||
|
|
||||||
# Import salt libs
|
# Import salt libs
|
||||||
from salt.modules.inspectlib.collector import Inspector
|
from salt.modules.inspectlib.collector import Inspector
|
||||||
|
|
||||||
|
|
||||||
@skipIf(NO_MOCK, NO_MOCK_REASON)
|
|
||||||
@skipIf(no_symlinks(), "Git missing 'core.symlinks=true' config")
|
@skipIf(no_symlinks(), "Git missing 'core.symlinks=true' config")
|
||||||
class InspectorCollectorTestCase(TestCase):
|
class InspectorCollectorTestCase(TestCase):
|
||||||
'''
|
'''
|
||||||
|
|
|
@ -12,11 +12,10 @@ from salt.exceptions import SaltInvocationError
|
||||||
|
|
||||||
# Import Salt Testing Libs
|
# Import Salt Testing Libs
|
||||||
from tests.support.mixins import LoaderModuleMockMixin
|
from tests.support.mixins import LoaderModuleMockMixin
|
||||||
from tests.support.unit import TestCase, skipIf
|
from tests.support.unit import TestCase
|
||||||
from tests.support.mock import MagicMock, patch, NO_MOCK, NO_MOCK_REASON
|
from tests.support.mock import MagicMock, patch
|
||||||
|
|
||||||
|
|
||||||
@skipIf(NO_MOCK, NO_MOCK_REASON)
|
|
||||||
class AliasesTestCase(TestCase, LoaderModuleMockMixin):
|
class AliasesTestCase(TestCase, LoaderModuleMockMixin):
|
||||||
'''
|
'''
|
||||||
TestCase for salt.modules.aliases module
|
TestCase for salt.modules.aliases module
|
||||||
|
|
|
@ -11,16 +11,15 @@
|
||||||
from __future__ import absolute_import, print_function, unicode_literals
|
from __future__ import absolute_import, print_function, unicode_literals
|
||||||
|
|
||||||
# Import Salt Testing libs
|
# Import Salt Testing libs
|
||||||
from tests.support.mixins import LoaderModuleMockMixin
|
from tests.support.unit import TestCase
|
||||||
from tests.support.unit import skipIf, TestCase
|
|
||||||
from tests.support.helpers import TstSuiteLoggingHandler
|
from tests.support.helpers import TstSuiteLoggingHandler
|
||||||
from tests.support.mock import NO_MOCK, NO_MOCK_REASON, MagicMock, patch
|
from tests.support.mixins import LoaderModuleMockMixin
|
||||||
|
from tests.support.mock import MagicMock, patch
|
||||||
|
|
||||||
# Import salt libs
|
# Import salt libs
|
||||||
import salt.modules.alternatives as alternatives
|
import salt.modules.alternatives as alternatives
|
||||||
|
|
||||||
|
|
||||||
@skipIf(NO_MOCK, NO_MOCK_REASON)
|
|
||||||
class AlternativesTestCase(TestCase, LoaderModuleMockMixin):
|
class AlternativesTestCase(TestCase, LoaderModuleMockMixin):
|
||||||
|
|
||||||
def setup_loader_modules(self):
|
def setup_loader_modules(self):
|
||||||
|
|
|
@ -29,8 +29,6 @@ from tests.support.unit import TestCase, skipIf
|
||||||
from tests.support.mock import (
|
from tests.support.mock import (
|
||||||
patch,
|
patch,
|
||||||
MagicMock,
|
MagicMock,
|
||||||
NO_MOCK,
|
|
||||||
NO_MOCK_REASON
|
|
||||||
)
|
)
|
||||||
|
|
||||||
import salt.modules.ansiblegate as ansible
|
import salt.modules.ansiblegate as ansible
|
||||||
|
@ -38,7 +36,6 @@ import salt.utils.platform
|
||||||
from salt.exceptions import LoaderError
|
from salt.exceptions import LoaderError
|
||||||
|
|
||||||
|
|
||||||
@skipIf(NO_MOCK, NO_MOCK_REASON)
|
|
||||||
@skipIf(NO_PYTEST, False)
|
@skipIf(NO_PYTEST, False)
|
||||||
@skipIf(salt.utils.platform.is_windows(), 'Not supported on Windows')
|
@skipIf(salt.utils.platform.is_windows(), 'Not supported on Windows')
|
||||||
class AnsiblegateTestCase(TestCase, LoaderModuleMockMixin):
|
class AnsiblegateTestCase(TestCase, LoaderModuleMockMixin):
|
||||||
|
|
|
@ -8,13 +8,11 @@ from __future__ import absolute_import, print_function, unicode_literals
|
||||||
|
|
||||||
# Import Salt Testing Libs
|
# Import Salt Testing Libs
|
||||||
from tests.support.mixins import LoaderModuleMockMixin
|
from tests.support.mixins import LoaderModuleMockMixin
|
||||||
from tests.support.unit import TestCase, skipIf
|
from tests.support.unit import TestCase
|
||||||
from tests.support.mock import (
|
from tests.support.mock import (
|
||||||
MagicMock,
|
MagicMock,
|
||||||
patch,
|
patch,
|
||||||
mock_open,
|
mock_open,
|
||||||
NO_MOCK,
|
|
||||||
NO_MOCK_REASON
|
|
||||||
)
|
)
|
||||||
|
|
||||||
# Import Salt Libs
|
# Import Salt Libs
|
||||||
|
@ -23,7 +21,6 @@ from salt.ext.six.moves.urllib.error import URLError # pylint: disable=import-e
|
||||||
from salt.utils.odict import OrderedDict
|
from salt.utils.odict import OrderedDict
|
||||||
|
|
||||||
|
|
||||||
@skipIf(NO_MOCK, NO_MOCK_REASON)
|
|
||||||
class ApacheTestCase(TestCase, LoaderModuleMockMixin):
|
class ApacheTestCase(TestCase, LoaderModuleMockMixin):
|
||||||
'''
|
'''
|
||||||
Test cases for salt.modules.apache
|
Test cases for salt.modules.apache
|
||||||
|
|
|
@ -14,7 +14,7 @@ import textwrap
|
||||||
# Import Salt Testing Libs
|
# Import Salt Testing Libs
|
||||||
from tests.support.mixins import LoaderModuleMockMixin
|
from tests.support.mixins import LoaderModuleMockMixin
|
||||||
from tests.support.unit import TestCase, skipIf
|
from tests.support.unit import TestCase, skipIf
|
||||||
from tests.support.mock import Mock, MagicMock, patch, NO_MOCK, NO_MOCK_REASON
|
from tests.support.mock import Mock, MagicMock, patch
|
||||||
|
|
||||||
# Import Salt Libs
|
# Import Salt Libs
|
||||||
from salt.ext import six
|
from salt.ext import six
|
||||||
|
@ -158,7 +158,6 @@ UNINSTALL = {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@skipIf(NO_MOCK, NO_MOCK_REASON)
|
|
||||||
class AptPkgTestCase(TestCase, LoaderModuleMockMixin):
|
class AptPkgTestCase(TestCase, LoaderModuleMockMixin):
|
||||||
'''
|
'''
|
||||||
Test cases for salt.modules.aptpkg
|
Test cases for salt.modules.aptpkg
|
||||||
|
|
|
@ -14,7 +14,7 @@ import os.path
|
||||||
# Import Salt Testing libs
|
# Import Salt Testing libs
|
||||||
from tests.support.mixins import LoaderModuleMockMixin
|
from tests.support.mixins import LoaderModuleMockMixin
|
||||||
from tests.support.unit import skipIf, TestCase
|
from tests.support.unit import skipIf, TestCase
|
||||||
from tests.support.mock import NO_MOCK, NO_MOCK_REASON, MagicMock, patch
|
from tests.support.mock import MagicMock, patch
|
||||||
|
|
||||||
# Import salt libs
|
# Import salt libs
|
||||||
import salt.modules.archive as archive
|
import salt.modules.archive as archive
|
||||||
|
@ -37,7 +37,6 @@ class ZipFileMock(MagicMock):
|
||||||
return self._files
|
return self._files
|
||||||
|
|
||||||
|
|
||||||
@skipIf(NO_MOCK, NO_MOCK_REASON)
|
|
||||||
class ArchiveTestCase(TestCase, LoaderModuleMockMixin):
|
class ArchiveTestCase(TestCase, LoaderModuleMockMixin):
|
||||||
|
|
||||||
def setup_loader_modules(self):
|
def setup_loader_modules(self):
|
||||||
|
|
|
@ -5,14 +5,13 @@ from __future__ import absolute_import, print_function, unicode_literals
|
||||||
|
|
||||||
# Import Salt testing libs
|
# Import Salt testing libs
|
||||||
from tests.support.mixins import LoaderModuleMockMixin
|
from tests.support.mixins import LoaderModuleMockMixin
|
||||||
from tests.support.unit import skipIf, TestCase
|
from tests.support.unit import TestCase
|
||||||
from tests.support.mock import NO_MOCK, NO_MOCK_REASON, MagicMock, patch
|
from tests.support.mock import MagicMock, patch
|
||||||
|
|
||||||
# Import Salt libs
|
# Import Salt libs
|
||||||
import salt.modules.artifactory as artifactory
|
import salt.modules.artifactory as artifactory
|
||||||
|
|
||||||
|
|
||||||
@skipIf(NO_MOCK, NO_MOCK_REASON)
|
|
||||||
class ArtifactoryTestCase(TestCase, LoaderModuleMockMixin):
|
class ArtifactoryTestCase(TestCase, LoaderModuleMockMixin):
|
||||||
|
|
||||||
def setup_loader_modules(self):
|
def setup_loader_modules(self):
|
||||||
|
|
|
@ -8,12 +8,10 @@ from __future__ import absolute_import, print_function, unicode_literals
|
||||||
|
|
||||||
# Import Salt Testing Libs
|
# Import Salt Testing Libs
|
||||||
from tests.support.mixins import LoaderModuleMockMixin
|
from tests.support.mixins import LoaderModuleMockMixin
|
||||||
from tests.support.unit import TestCase, skipIf
|
from tests.support.unit import TestCase
|
||||||
from tests.support.mock import (
|
from tests.support.mock import (
|
||||||
MagicMock,
|
MagicMock,
|
||||||
patch,
|
patch,
|
||||||
NO_MOCK,
|
|
||||||
NO_MOCK_REASON
|
|
||||||
)
|
)
|
||||||
|
|
||||||
# Import Salt Libs
|
# Import Salt Libs
|
||||||
|
@ -21,7 +19,6 @@ import salt.utils.path
|
||||||
import salt.modules.at as at
|
import salt.modules.at as at
|
||||||
|
|
||||||
|
|
||||||
@skipIf(NO_MOCK, NO_MOCK_REASON)
|
|
||||||
class AtTestCase(TestCase, LoaderModuleMockMixin):
|
class AtTestCase(TestCase, LoaderModuleMockMixin):
|
||||||
'''
|
'''
|
||||||
TestCase for the salt.modules.at module
|
TestCase for the salt.modules.at module
|
||||||
|
|
|
@ -13,11 +13,7 @@ import salt.modules.azurearm_dns as azurearm_dns
|
||||||
# Import Salt Testing Libs
|
# Import Salt Testing Libs
|
||||||
from tests.support.mixins import LoaderModuleMockMixin
|
from tests.support.mixins import LoaderModuleMockMixin
|
||||||
from tests.support.unit import skipIf, TestCase
|
from tests.support.unit import skipIf, TestCase
|
||||||
from tests.support.mock import (
|
from tests.support.mock import MagicMock
|
||||||
MagicMock,
|
|
||||||
NO_MOCK,
|
|
||||||
NO_MOCK_REASON
|
|
||||||
)
|
|
||||||
|
|
||||||
# Azure libs
|
# Azure libs
|
||||||
# pylint: disable=import-error
|
# pylint: disable=import-error
|
||||||
|
@ -111,7 +107,6 @@ class AzureClientMock(object):
|
||||||
return MagicMock(return_value=self.__return_value)()
|
return MagicMock(return_value=self.__return_value)()
|
||||||
|
|
||||||
|
|
||||||
@skipIf(NO_MOCK, NO_MOCK_REASON)
|
|
||||||
@skipIf(HAS_LIBS is False, 'The azure.mgmt.dns module must be installed.')
|
@skipIf(HAS_LIBS is False, 'The azure.mgmt.dns module must be installed.')
|
||||||
class AzureRmDnsTestCase(TestCase, LoaderModuleMockMixin):
|
class AzureRmDnsTestCase(TestCase, LoaderModuleMockMixin):
|
||||||
'''
|
'''
|
||||||
|
|
|
@ -10,12 +10,10 @@ import os
|
||||||
# Import Salt Testing Libs
|
# Import Salt Testing Libs
|
||||||
from tests.support.runtests import RUNTIME_VARS
|
from tests.support.runtests import RUNTIME_VARS
|
||||||
from tests.support.mixins import LoaderModuleMockMixin
|
from tests.support.mixins import LoaderModuleMockMixin
|
||||||
from tests.support.unit import TestCase, skipIf
|
from tests.support.unit import TestCase
|
||||||
from tests.support.mock import (
|
from tests.support.mock import (
|
||||||
MagicMock,
|
MagicMock,
|
||||||
patch,
|
patch,
|
||||||
NO_MOCK,
|
|
||||||
NO_MOCK_REASON
|
|
||||||
)
|
)
|
||||||
|
|
||||||
# Import Salt Libs
|
# Import Salt Libs
|
||||||
|
@ -23,7 +21,6 @@ import salt.modules.beacons as beacons
|
||||||
from salt.utils.event import SaltEvent
|
from salt.utils.event import SaltEvent
|
||||||
|
|
||||||
|
|
||||||
@skipIf(NO_MOCK, NO_MOCK_REASON)
|
|
||||||
class BeaconsTestCase(TestCase, LoaderModuleMockMixin):
|
class BeaconsTestCase(TestCase, LoaderModuleMockMixin):
|
||||||
'''
|
'''
|
||||||
Test cases for salt.modules.beacons
|
Test cases for salt.modules.beacons
|
||||||
|
|
|
@ -8,12 +8,10 @@ from __future__ import absolute_import, print_function, unicode_literals
|
||||||
|
|
||||||
# Import Salt Testing Libs
|
# Import Salt Testing Libs
|
||||||
from tests.support.mixins import LoaderModuleMockMixin
|
from tests.support.mixins import LoaderModuleMockMixin
|
||||||
from tests.support.unit import TestCase, skipIf
|
from tests.support.unit import TestCase
|
||||||
from tests.support.mock import (
|
from tests.support.mock import (
|
||||||
MagicMock,
|
MagicMock,
|
||||||
patch,
|
patch,
|
||||||
NO_MOCK,
|
|
||||||
NO_MOCK_REASON
|
|
||||||
)
|
)
|
||||||
|
|
||||||
# Import Salt Libs
|
# Import Salt Libs
|
||||||
|
@ -37,7 +35,6 @@ class MockBluetooth(object):
|
||||||
return [['a', 'b', 'c'], ['d', 'e', 'f']]
|
return [['a', 'b', 'c'], ['d', 'e', 'f']]
|
||||||
|
|
||||||
|
|
||||||
@skipIf(NO_MOCK, NO_MOCK_REASON)
|
|
||||||
class BluezTestCase(TestCase, LoaderModuleMockMixin):
|
class BluezTestCase(TestCase, LoaderModuleMockMixin):
|
||||||
'''
|
'''
|
||||||
Test cases for salt.modules.bluez
|
Test cases for salt.modules.bluez
|
||||||
|
|
|
@ -10,7 +10,7 @@ import string
|
||||||
# Import Salt Testing libs
|
# Import Salt Testing libs
|
||||||
from tests.support.mixins import LoaderModuleMockMixin
|
from tests.support.mixins import LoaderModuleMockMixin
|
||||||
from tests.support.unit import skipIf, TestCase
|
from tests.support.unit import skipIf, TestCase
|
||||||
from tests.support.mock import NO_MOCK, NO_MOCK_REASON, MagicMock, patch
|
from tests.support.mock import MagicMock, patch
|
||||||
|
|
||||||
# Import Salt libs
|
# Import Salt libs
|
||||||
import salt.loader
|
import salt.loader
|
||||||
|
@ -232,7 +232,6 @@ class BotoApiGatewayTestCaseMixin(object):
|
||||||
@skipIf(_has_required_botocore() is False,
|
@skipIf(_has_required_botocore() is False,
|
||||||
'The botocore module must be greater than'
|
'The botocore module must be greater than'
|
||||||
' or equal to version {0}'.format(required_botocore_version))
|
' or equal to version {0}'.format(required_botocore_version))
|
||||||
@skipIf(NO_MOCK, NO_MOCK_REASON)
|
|
||||||
class BotoApiGatewayTestCase(BotoApiGatewayTestCaseBase, BotoApiGatewayTestCaseMixin):
|
class BotoApiGatewayTestCase(BotoApiGatewayTestCaseBase, BotoApiGatewayTestCaseMixin):
|
||||||
'''
|
'''
|
||||||
TestCase for salt.modules.boto_apigateway module
|
TestCase for salt.modules.boto_apigateway module
|
||||||
|
|
|
@ -11,8 +11,6 @@ from tests.support.mixins import LoaderModuleMockMixin
|
||||||
from tests.support.unit import skipIf, TestCase
|
from tests.support.unit import skipIf, TestCase
|
||||||
from tests.support.mock import (
|
from tests.support.mock import (
|
||||||
MagicMock,
|
MagicMock,
|
||||||
NO_MOCK,
|
|
||||||
NO_MOCK_REASON,
|
|
||||||
patch
|
patch
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -97,7 +95,6 @@ if _has_required_boto():
|
||||||
@skipIf(_has_required_boto() is False, 'The boto3 module must be greater than'
|
@skipIf(_has_required_boto() is False, 'The boto3 module must be greater than'
|
||||||
' or equal to version {0}'
|
' or equal to version {0}'
|
||||||
.format(required_boto3_version))
|
.format(required_boto3_version))
|
||||||
@skipIf(NO_MOCK, NO_MOCK_REASON)
|
|
||||||
class BotoCloudTrailTestCaseBase(TestCase, LoaderModuleMockMixin):
|
class BotoCloudTrailTestCaseBase(TestCase, LoaderModuleMockMixin):
|
||||||
conn = None
|
conn = None
|
||||||
|
|
||||||
|
|
|
@ -11,8 +11,6 @@ from tests.support.mixins import LoaderModuleMockMixin
|
||||||
from tests.support.unit import skipIf, TestCase
|
from tests.support.unit import skipIf, TestCase
|
||||||
from tests.support.mock import (
|
from tests.support.mock import (
|
||||||
MagicMock,
|
MagicMock,
|
||||||
NO_MOCK,
|
|
||||||
NO_MOCK_REASON,
|
|
||||||
patch
|
patch
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -125,7 +123,6 @@ class BotoCloudWatchEventTestCaseMixin(object):
|
||||||
|
|
||||||
|
|
||||||
@skipIf(HAS_BOTO is False, 'The boto module must be installed.')
|
@skipIf(HAS_BOTO is False, 'The boto module must be installed.')
|
||||||
@skipIf(NO_MOCK, NO_MOCK_REASON)
|
|
||||||
class BotoCloudWatchEventTestCase(BotoCloudWatchEventTestCaseBase, BotoCloudWatchEventTestCaseMixin):
|
class BotoCloudWatchEventTestCase(BotoCloudWatchEventTestCaseBase, BotoCloudWatchEventTestCaseMixin):
|
||||||
'''
|
'''
|
||||||
TestCase for salt.modules.boto_cloudwatch_event module
|
TestCase for salt.modules.boto_cloudwatch_event module
|
||||||
|
|
|
@ -9,7 +9,7 @@ import string
|
||||||
# Import Salt Testing libs
|
# Import Salt Testing libs
|
||||||
from tests.support.mixins import LoaderModuleMockMixin
|
from tests.support.mixins import LoaderModuleMockMixin
|
||||||
from tests.support.unit import skipIf, TestCase
|
from tests.support.unit import skipIf, TestCase
|
||||||
from tests.support.mock import NO_MOCK, NO_MOCK_REASON, MagicMock, patch
|
from tests.support.mock import MagicMock, patch
|
||||||
|
|
||||||
# Import Salt libs
|
# Import Salt libs
|
||||||
import salt.config
|
import salt.config
|
||||||
|
@ -154,7 +154,6 @@ class BotoCognitoIdentityTestCaseMixin(object):
|
||||||
@skipIf(_has_required_boto() is False, 'The boto3 module must be greater than'
|
@skipIf(_has_required_boto() is False, 'The boto3 module must be greater than'
|
||||||
' or equal to version {0}'
|
' or equal to version {0}'
|
||||||
.format(required_boto3_version))
|
.format(required_boto3_version))
|
||||||
@skipIf(NO_MOCK, NO_MOCK_REASON)
|
|
||||||
class BotoCognitoIdentityTestCase(BotoCognitoIdentityTestCaseBase, BotoCognitoIdentityTestCaseMixin):
|
class BotoCognitoIdentityTestCase(BotoCognitoIdentityTestCaseBase, BotoCognitoIdentityTestCaseMixin):
|
||||||
'''
|
'''
|
||||||
TestCase for salt.modules.boto_cognitoidentity module
|
TestCase for salt.modules.boto_cognitoidentity module
|
||||||
|
|
|
@ -11,8 +11,6 @@ import string
|
||||||
from tests.support.mixins import LoaderModuleMockMixin
|
from tests.support.mixins import LoaderModuleMockMixin
|
||||||
from tests.support.unit import skipIf, TestCase
|
from tests.support.unit import skipIf, TestCase
|
||||||
from tests.support.mock import (
|
from tests.support.mock import (
|
||||||
NO_MOCK,
|
|
||||||
NO_MOCK_REASON,
|
|
||||||
MagicMock,
|
MagicMock,
|
||||||
patch
|
patch
|
||||||
)
|
)
|
||||||
|
@ -126,7 +124,6 @@ class BotoElasticsearchDomainTestCaseMixin(object):
|
||||||
@skipIf(_has_required_boto() is False, 'The boto3 module must be greater than'
|
@skipIf(_has_required_boto() is False, 'The boto3 module must be greater than'
|
||||||
' or equal to version {0}'
|
' or equal to version {0}'
|
||||||
.format(required_boto3_version))
|
.format(required_boto3_version))
|
||||||
@skipIf(NO_MOCK, NO_MOCK_REASON)
|
|
||||||
class BotoElasticsearchDomainTestCase(BotoElasticsearchDomainTestCaseBase, BotoElasticsearchDomainTestCaseMixin):
|
class BotoElasticsearchDomainTestCase(BotoElasticsearchDomainTestCaseBase, BotoElasticsearchDomainTestCaseMixin):
|
||||||
'''
|
'''
|
||||||
TestCase for salt.modules.boto_elasticsearch_domain module
|
TestCase for salt.modules.boto_elasticsearch_domain module
|
||||||
|
|
|
@ -60,7 +60,6 @@ import salt.utils.versions
|
||||||
# Import Salt Testing Libs
|
# Import Salt Testing Libs
|
||||||
from tests.support.mixins import LoaderModuleMockMixin
|
from tests.support.mixins import LoaderModuleMockMixin
|
||||||
from tests.support.unit import skipIf, TestCase
|
from tests.support.unit import skipIf, TestCase
|
||||||
from tests.support.mock import NO_MOCK, NO_MOCK_REASON
|
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
@ -93,7 +92,6 @@ def _has_required_moto():
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
||||||
@skipIf(NO_MOCK, NO_MOCK_REASON)
|
|
||||||
@skipIf(HAS_BOTO is False, 'The boto module must be installed.')
|
@skipIf(HAS_BOTO is False, 'The boto module must be installed.')
|
||||||
@skipIf(HAS_MOTO is False, 'The moto module must be installed.')
|
@skipIf(HAS_MOTO is False, 'The moto module must be installed.')
|
||||||
@skipIf(_has_required_moto() is False, 'The moto module must be >= to {0} for '
|
@skipIf(_has_required_moto() is False, 'The moto module must be >= to {0} for '
|
||||||
|
|
|
@ -11,8 +11,6 @@ from tests.support.mixins import LoaderModuleMockMixin
|
||||||
from tests.support.unit import skipIf, TestCase
|
from tests.support.unit import skipIf, TestCase
|
||||||
from tests.support.mock import (
|
from tests.support.mock import (
|
||||||
MagicMock,
|
MagicMock,
|
||||||
NO_MOCK,
|
|
||||||
NO_MOCK_REASON,
|
|
||||||
patch
|
patch
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -122,7 +120,6 @@ if _has_required_boto():
|
||||||
@skipIf(_has_required_boto() is False, 'The boto3 module must be greater than'
|
@skipIf(_has_required_boto() is False, 'The boto3 module must be greater than'
|
||||||
' or equal to version {0}'
|
' or equal to version {0}'
|
||||||
.format(required_boto3_version))
|
.format(required_boto3_version))
|
||||||
@skipIf(NO_MOCK, NO_MOCK_REASON)
|
|
||||||
class BotoIoTTestCaseBase(TestCase, LoaderModuleMockMixin):
|
class BotoIoTTestCaseBase(TestCase, LoaderModuleMockMixin):
|
||||||
conn = None
|
conn = None
|
||||||
|
|
||||||
|
@ -635,7 +632,6 @@ class BotoIoTPolicyTestCase(BotoIoTTestCaseBase, BotoIoTTestCaseMixin):
|
||||||
' module must be greater than or equal to'
|
' module must be greater than or equal to'
|
||||||
' version {1}.'
|
' version {1}.'
|
||||||
.format(required_boto3_version, required_botocore_version))
|
.format(required_boto3_version, required_botocore_version))
|
||||||
@skipIf(NO_MOCK, NO_MOCK_REASON)
|
|
||||||
class BotoIoTTopicRuleTestCase(BotoIoTTestCaseBase, BotoIoTTestCaseMixin):
|
class BotoIoTTopicRuleTestCase(BotoIoTTestCaseBase, BotoIoTTestCaseMixin):
|
||||||
'''
|
'''
|
||||||
TestCase for salt.modules.boto_iot module
|
TestCase for salt.modules.boto_iot module
|
||||||
|
|
|
@ -19,8 +19,6 @@ from tests.support.mixins import LoaderModuleMockMixin
|
||||||
from tests.support.unit import skipIf, TestCase
|
from tests.support.unit import skipIf, TestCase
|
||||||
from tests.support.mock import (
|
from tests.support.mock import (
|
||||||
MagicMock,
|
MagicMock,
|
||||||
NO_MOCK,
|
|
||||||
NO_MOCK_REASON,
|
|
||||||
patch
|
patch
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -117,7 +115,6 @@ def _has_required_boto():
|
||||||
('The boto3 module must be greater than or equal to version {0}, '
|
('The boto3 module must be greater than or equal to version {0}, '
|
||||||
'and botocore must be greater than or equal to {1}'.format(
|
'and botocore must be greater than or equal to {1}'.format(
|
||||||
required_boto3_version, required_botocore_version)))
|
required_boto3_version, required_botocore_version)))
|
||||||
@skipIf(NO_MOCK, NO_MOCK_REASON)
|
|
||||||
class BotoLambdaTestCaseBase(TestCase, LoaderModuleMockMixin):
|
class BotoLambdaTestCaseBase(TestCase, LoaderModuleMockMixin):
|
||||||
conn = None
|
conn = None
|
||||||
|
|
||||||
|
@ -468,7 +465,6 @@ class BotoLambdaFunctionTestCase(BotoLambdaTestCaseBase, BotoLambdaTestCaseMixin
|
||||||
@skipIf(_has_required_boto() is False, 'The boto3 module must be greater than'
|
@skipIf(_has_required_boto() is False, 'The boto3 module must be greater than'
|
||||||
' or equal to version {0}'
|
' or equal to version {0}'
|
||||||
.format(required_boto3_version))
|
.format(required_boto3_version))
|
||||||
@skipIf(NO_MOCK, NO_MOCK_REASON)
|
|
||||||
class BotoLambdaAliasTestCase(BotoLambdaTestCaseBase, BotoLambdaTestCaseMixin):
|
class BotoLambdaAliasTestCase(BotoLambdaTestCaseBase, BotoLambdaTestCaseMixin):
|
||||||
'''
|
'''
|
||||||
TestCase for salt.modules.boto_lambda module aliases
|
TestCase for salt.modules.boto_lambda module aliases
|
||||||
|
@ -619,7 +615,6 @@ class BotoLambdaAliasTestCase(BotoLambdaTestCaseBase, BotoLambdaTestCaseMixin):
|
||||||
@skipIf(_has_required_boto() is False, 'The boto3 module must be greater than'
|
@skipIf(_has_required_boto() is False, 'The boto3 module must be greater than'
|
||||||
' or equal to version {0}'
|
' or equal to version {0}'
|
||||||
.format(required_boto3_version))
|
.format(required_boto3_version))
|
||||||
@skipIf(NO_MOCK, NO_MOCK_REASON)
|
|
||||||
class BotoLambdaEventSourceMappingTestCase(BotoLambdaTestCaseBase, BotoLambdaTestCaseMixin):
|
class BotoLambdaEventSourceMappingTestCase(BotoLambdaTestCaseBase, BotoLambdaTestCaseMixin):
|
||||||
'''
|
'''
|
||||||
TestCase for salt.modules.boto_lambda module mappings
|
TestCase for salt.modules.boto_lambda module mappings
|
||||||
|
|
|
@ -18,7 +18,6 @@ import salt.utils.versions
|
||||||
# Import Salt Testing Libs
|
# Import Salt Testing Libs
|
||||||
from tests.support.mixins import LoaderModuleMockMixin
|
from tests.support.mixins import LoaderModuleMockMixin
|
||||||
from tests.support.unit import skipIf, TestCase
|
from tests.support.unit import skipIf, TestCase
|
||||||
from tests.support.mock import NO_MOCK, NO_MOCK_REASON
|
|
||||||
from tests.support.runtests import RUNTIME_VARS
|
from tests.support.runtests import RUNTIME_VARS
|
||||||
|
|
||||||
# import Python Third Party Libs
|
# import Python Third Party Libs
|
||||||
|
@ -66,7 +65,6 @@ def _has_required_moto():
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
||||||
@skipIf(NO_MOCK, NO_MOCK_REASON)
|
|
||||||
@skipIf(HAS_MOTO is False, 'The moto module must be installed.')
|
@skipIf(HAS_MOTO is False, 'The moto module must be installed.')
|
||||||
@skipIf(_has_required_moto() is False, 'The moto module must be >= to {0} for '
|
@skipIf(_has_required_moto() is False, 'The moto module must be >= to {0} for '
|
||||||
'PY2 or {1} for PY3.'.format(required_moto, required_moto_py3))
|
'PY2 or {1} for PY3.'.format(required_moto, required_moto_py3))
|
||||||
|
|
|
@ -12,8 +12,6 @@ from tests.support.mixins import LoaderModuleMockMixin
|
||||||
from tests.support.unit import skipIf, TestCase
|
from tests.support.unit import skipIf, TestCase
|
||||||
from tests.support.mock import (
|
from tests.support.mock import (
|
||||||
MagicMock,
|
MagicMock,
|
||||||
NO_MOCK,
|
|
||||||
NO_MOCK_REASON,
|
|
||||||
patch
|
patch
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -200,7 +198,6 @@ if _has_required_boto():
|
||||||
@skipIf(_has_required_boto() is False, 'The boto3 module must be greater than'
|
@skipIf(_has_required_boto() is False, 'The boto3 module must be greater than'
|
||||||
' or equal to version {0}'
|
' or equal to version {0}'
|
||||||
.format(required_boto3_version))
|
.format(required_boto3_version))
|
||||||
@skipIf(NO_MOCK, NO_MOCK_REASON)
|
|
||||||
class BotoS3BucketTestCaseBase(TestCase, LoaderModuleMockMixin):
|
class BotoS3BucketTestCaseBase(TestCase, LoaderModuleMockMixin):
|
||||||
conn = None
|
conn = None
|
||||||
|
|
||||||
|
|
|
@ -11,7 +11,6 @@ import sys
|
||||||
# Import Salt Testing Libs
|
# Import Salt Testing Libs
|
||||||
from tests.support.mixins import LoaderModuleMockMixin
|
from tests.support.mixins import LoaderModuleMockMixin
|
||||||
from tests.support.unit import skipIf, TestCase
|
from tests.support.unit import skipIf, TestCase
|
||||||
from tests.support.mock import NO_MOCK, NO_MOCK_REASON
|
|
||||||
from tests.support.runtests import RUNTIME_VARS
|
from tests.support.runtests import RUNTIME_VARS
|
||||||
|
|
||||||
# Import Salt libs
|
# Import Salt libs
|
||||||
|
@ -83,7 +82,6 @@ def _has_required_boto():
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
||||||
@skipIf(NO_MOCK, NO_MOCK_REASON)
|
|
||||||
@skipIf(HAS_BOTO is False, 'The boto module must be installed.')
|
@skipIf(HAS_BOTO is False, 'The boto module must be installed.')
|
||||||
@skipIf(HAS_MOTO is False, 'The moto module must be installed.')
|
@skipIf(HAS_MOTO is False, 'The moto module must be installed.')
|
||||||
@skipIf(_has_required_boto() is False, 'The boto module must be greater than'
|
@skipIf(_has_required_boto() is False, 'The boto module must be greater than'
|
||||||
|
|
|
@ -17,7 +17,7 @@ from pkg_resources import DistributionNotFound
|
||||||
# Import Salt Testing libs
|
# Import Salt Testing libs
|
||||||
from tests.support.mixins import LoaderModuleMockMixin
|
from tests.support.mixins import LoaderModuleMockMixin
|
||||||
from tests.support.unit import skipIf, TestCase
|
from tests.support.unit import skipIf, TestCase
|
||||||
from tests.support.mock import NO_MOCK, NO_MOCK_REASON, MagicMock, patch
|
from tests.support.mock import MagicMock, patch
|
||||||
from tests.support.runtests import RUNTIME_VARS
|
from tests.support.runtests import RUNTIME_VARS
|
||||||
|
|
||||||
# Import Salt libs
|
# Import Salt libs
|
||||||
|
@ -128,7 +128,6 @@ def _has_required_moto():
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
||||||
@skipIf(NO_MOCK, NO_MOCK_REASON)
|
|
||||||
@skipIf(HAS_BOTO is False, 'The boto module must be installed.')
|
@skipIf(HAS_BOTO is False, 'The boto module must be installed.')
|
||||||
@skipIf(HAS_MOTO is False, 'The moto module must be installed.')
|
@skipIf(HAS_MOTO is False, 'The moto module must be installed.')
|
||||||
@skipIf(_has_required_boto() is False, 'The boto module must be greater than'
|
@skipIf(_has_required_boto() is False, 'The boto module must be greater than'
|
||||||
|
@ -586,7 +585,6 @@ class BotoVpcTestCase(BotoVpcTestCaseBase, BotoVpcTestCaseMixin):
|
||||||
boto_vpc.describe(vpc_id=None, **conn_parameters)
|
boto_vpc.describe(vpc_id=None, **conn_parameters)
|
||||||
|
|
||||||
|
|
||||||
@skipIf(NO_MOCK, NO_MOCK_REASON)
|
|
||||||
@skipIf(HAS_BOTO is False, 'The boto module must be installed.')
|
@skipIf(HAS_BOTO is False, 'The boto module must be installed.')
|
||||||
@skipIf(HAS_MOTO is False, 'The moto module must be installed.')
|
@skipIf(HAS_MOTO is False, 'The moto module must be installed.')
|
||||||
@skipIf(_has_required_boto() is False, 'The boto module must be greater than'
|
@skipIf(_has_required_boto() is False, 'The boto module must be greater than'
|
||||||
|
@ -890,7 +888,6 @@ class BotoVpcSubnetsTestCase(BotoVpcTestCaseBase, BotoVpcTestCaseMixin):
|
||||||
self.assertEqual(describe_subnet_results['subnets'][0]['availability_zone'], 'us-east-1a')
|
self.assertEqual(describe_subnet_results['subnets'][0]['availability_zone'], 'us-east-1a')
|
||||||
|
|
||||||
|
|
||||||
@skipIf(NO_MOCK, NO_MOCK_REASON)
|
|
||||||
@skipIf(HAS_BOTO is False, 'The boto module must be installed.')
|
@skipIf(HAS_BOTO is False, 'The boto module must be installed.')
|
||||||
@skipIf(HAS_MOTO is False, 'The moto module must be installed.')
|
@skipIf(HAS_MOTO is False, 'The moto module must be installed.')
|
||||||
@skipIf(_has_required_boto() is False, 'The boto module must be greater than'
|
@skipIf(_has_required_boto() is False, 'The boto module must be greater than'
|
||||||
|
@ -952,7 +949,6 @@ class BotoVpcInternetGatewayTestCase(BotoVpcTestCaseBase, BotoVpcTestCaseMixin):
|
||||||
self.assertTrue(igw_creation_result.get('created'))
|
self.assertTrue(igw_creation_result.get('created'))
|
||||||
|
|
||||||
|
|
||||||
@skipIf(NO_MOCK, NO_MOCK_REASON)
|
|
||||||
@skipIf(HAS_BOTO is False, 'The boto module must be installed.')
|
@skipIf(HAS_BOTO is False, 'The boto module must be installed.')
|
||||||
@skipIf(HAS_MOTO is False, 'The moto module must be installed.')
|
@skipIf(HAS_MOTO is False, 'The moto module must be installed.')
|
||||||
@skipIf(_has_required_boto() is False, 'The boto module must be greater than'
|
@skipIf(_has_required_boto() is False, 'The boto module must be greater than'
|
||||||
|
@ -1002,7 +998,6 @@ class BotoVpcNatGatewayTestCase(BotoVpcTestCaseBase, BotoVpcTestCaseMixin):
|
||||||
self.assertTrue(ngw_creation_result.get('created'))
|
self.assertTrue(ngw_creation_result.get('created'))
|
||||||
|
|
||||||
|
|
||||||
@skipIf(NO_MOCK, NO_MOCK_REASON)
|
|
||||||
@skipIf(HAS_BOTO is False, 'The boto module must be installed.')
|
@skipIf(HAS_BOTO is False, 'The boto module must be installed.')
|
||||||
@skipIf(HAS_MOTO is False, 'The moto module must be installed.')
|
@skipIf(HAS_MOTO is False, 'The moto module must be installed.')
|
||||||
@skipIf(_has_required_boto() is False, 'The boto module must be greater than'
|
@skipIf(_has_required_boto() is False, 'The boto module must be greater than'
|
||||||
|
@ -1040,7 +1035,6 @@ class BotoVpcCustomerGatewayTestCase(BotoVpcTestCaseBase, BotoVpcTestCaseMixin):
|
||||||
self.assertFalse(gw_exists_result['exists'])
|
self.assertFalse(gw_exists_result['exists'])
|
||||||
|
|
||||||
|
|
||||||
@skipIf(NO_MOCK, NO_MOCK_REASON)
|
|
||||||
@skipIf(HAS_BOTO is False, 'The boto module must be installed.')
|
@skipIf(HAS_BOTO is False, 'The boto module must be installed.')
|
||||||
@skipIf(HAS_MOTO is False, 'The moto module must be installed.')
|
@skipIf(HAS_MOTO is False, 'The moto module must be installed.')
|
||||||
@skipIf(_has_required_boto() is False, 'The boto module must be greater than'
|
@skipIf(_has_required_boto() is False, 'The boto module must be greater than'
|
||||||
|
@ -1209,7 +1203,6 @@ class BotoVpcDHCPOptionsTestCase(BotoVpcTestCaseBase, BotoVpcTestCaseMixin):
|
||||||
boto_vpc.dhcp_options_exists(**conn_parameters)
|
boto_vpc.dhcp_options_exists(**conn_parameters)
|
||||||
|
|
||||||
|
|
||||||
@skipIf(NO_MOCK, NO_MOCK_REASON)
|
|
||||||
@skipIf(HAS_BOTO is False, 'The boto module must be installed.')
|
@skipIf(HAS_BOTO is False, 'The boto module must be installed.')
|
||||||
@skipIf(HAS_MOTO is False, 'The moto module must be installed.')
|
@skipIf(HAS_MOTO is False, 'The moto module must be installed.')
|
||||||
@skipIf(_has_required_boto() is False, 'The boto module must be greater than'
|
@skipIf(_has_required_boto() is False, 'The boto module must be greater than'
|
||||||
|
@ -1572,7 +1565,6 @@ class BotoVpcNetworkACLTestCase(BotoVpcTestCaseBase, BotoVpcTestCaseMixin):
|
||||||
self.assertFalse(dhcp_disassociate_result)
|
self.assertFalse(dhcp_disassociate_result)
|
||||||
|
|
||||||
|
|
||||||
@skipIf(NO_MOCK, NO_MOCK_REASON)
|
|
||||||
@skipIf(HAS_BOTO is False, 'The boto module must be installed.')
|
@skipIf(HAS_BOTO is False, 'The boto module must be installed.')
|
||||||
@skipIf(HAS_MOTO is False, 'The moto module must be installed.')
|
@skipIf(HAS_MOTO is False, 'The moto module must be installed.')
|
||||||
@skipIf(_has_required_boto() is False, 'The boto module must be greater than'
|
@skipIf(_has_required_boto() is False, 'The boto module must be greater than'
|
||||||
|
@ -1792,7 +1784,6 @@ class BotoVpcRouteTablesTestCase(BotoVpcTestCaseBase, BotoVpcTestCaseMixin):
|
||||||
self.assertFalse(route_replacing_result)
|
self.assertFalse(route_replacing_result)
|
||||||
|
|
||||||
|
|
||||||
@skipIf(NO_MOCK, NO_MOCK_REASON)
|
|
||||||
@skipIf(HAS_BOTO is False, 'The boto module must be installed.')
|
@skipIf(HAS_BOTO is False, 'The boto module must be installed.')
|
||||||
@skipIf(HAS_MOTO is False, 'The moto module must be installed.')
|
@skipIf(HAS_MOTO is False, 'The moto module must be installed.')
|
||||||
@skipIf(_has_required_boto() is False, 'The boto module must be greater than'
|
@skipIf(_has_required_boto() is False, 'The boto module must be greater than'
|
||||||
|
|
|
@ -8,15 +8,14 @@ from __future__ import absolute_import, print_function, unicode_literals
|
||||||
|
|
||||||
# Import Salt Testing Libs
|
# Import Salt Testing Libs
|
||||||
from tests.support.mixins import LoaderModuleMockMixin
|
from tests.support.mixins import LoaderModuleMockMixin
|
||||||
from tests.support.unit import TestCase, skipIf
|
from tests.support.unit import TestCase
|
||||||
from tests.support.mock import MagicMock, patch, NO_MOCK, NO_MOCK_REASON
|
from tests.support.mock import MagicMock, patch
|
||||||
|
|
||||||
# Import Salt Libs
|
# Import Salt Libs
|
||||||
import salt.modules.bower as bower
|
import salt.modules.bower as bower
|
||||||
from salt.exceptions import CommandExecutionError
|
from salt.exceptions import CommandExecutionError
|
||||||
|
|
||||||
|
|
||||||
@skipIf(NO_MOCK, NO_MOCK_REASON)
|
|
||||||
class BowerTestCase(TestCase, LoaderModuleMockMixin):
|
class BowerTestCase(TestCase, LoaderModuleMockMixin):
|
||||||
'''
|
'''
|
||||||
Test cases for salt.modules.bower
|
Test cases for salt.modules.bower
|
||||||
|
|
|
@ -8,14 +8,13 @@ from __future__ import absolute_import, print_function, unicode_literals
|
||||||
|
|
||||||
# Import Salt Testing Libs
|
# Import Salt Testing Libs
|
||||||
from tests.support.mixins import LoaderModuleMockMixin
|
from tests.support.mixins import LoaderModuleMockMixin
|
||||||
from tests.support.unit import TestCase, skipIf
|
from tests.support.unit import TestCase
|
||||||
from tests.support.mock import MagicMock, patch, NO_MOCK, NO_MOCK_REASON
|
from tests.support.mock import MagicMock, patch
|
||||||
|
|
||||||
# Import Salt Libs
|
# Import Salt Libs
|
||||||
import salt.modules.bridge as bridge
|
import salt.modules.bridge as bridge
|
||||||
|
|
||||||
|
|
||||||
@skipIf(NO_MOCK, NO_MOCK_REASON)
|
|
||||||
class BridgeTestCase(TestCase, LoaderModuleMockMixin):
|
class BridgeTestCase(TestCase, LoaderModuleMockMixin):
|
||||||
'''
|
'''
|
||||||
Test cases for salt.modules.bridge
|
Test cases for salt.modules.bridge
|
||||||
|
|
|
@ -7,13 +7,11 @@ from __future__ import absolute_import, print_function, unicode_literals
|
||||||
|
|
||||||
# Import Salt Testing Libs
|
# Import Salt Testing Libs
|
||||||
from tests.support.mixins import LoaderModuleMockMixin
|
from tests.support.mixins import LoaderModuleMockMixin
|
||||||
from tests.support.unit import TestCase, skipIf
|
from tests.support.unit import TestCase
|
||||||
from tests.support.mock import (
|
from tests.support.mock import (
|
||||||
mock_open,
|
mock_open,
|
||||||
MagicMock,
|
MagicMock,
|
||||||
patch,
|
patch,
|
||||||
NO_MOCK,
|
|
||||||
NO_MOCK_REASON
|
|
||||||
)
|
)
|
||||||
|
|
||||||
# Import Salt Libs
|
# Import Salt Libs
|
||||||
|
@ -23,7 +21,6 @@ import salt.modules.btrfs as btrfs
|
||||||
from salt.exceptions import CommandExecutionError
|
from salt.exceptions import CommandExecutionError
|
||||||
|
|
||||||
|
|
||||||
@skipIf(NO_MOCK, NO_MOCK_REASON)
|
|
||||||
class BtrfsTestCase(TestCase, LoaderModuleMockMixin):
|
class BtrfsTestCase(TestCase, LoaderModuleMockMixin):
|
||||||
'''
|
'''
|
||||||
Test cases for salt.modules.btrfs
|
Test cases for salt.modules.btrfs
|
||||||
|
|
|
@ -7,12 +7,10 @@ from __future__ import absolute_import, unicode_literals, print_function
|
||||||
|
|
||||||
# Import Salt Testing Libs
|
# Import Salt Testing Libs
|
||||||
from tests.support.mixins import LoaderModuleMockMixin
|
from tests.support.mixins import LoaderModuleMockMixin
|
||||||
from tests.support.unit import TestCase, skipIf
|
from tests.support.unit import TestCase
|
||||||
from tests.support.mock import (
|
from tests.support.mock import (
|
||||||
MagicMock,
|
MagicMock,
|
||||||
patch,
|
patch,
|
||||||
NO_MOCK,
|
|
||||||
NO_MOCK_REASON
|
|
||||||
)
|
)
|
||||||
|
|
||||||
# Import Salt Libs
|
# Import Salt Libs
|
||||||
|
@ -20,7 +18,6 @@ from salt.ext import six
|
||||||
import salt.modules.cassandra as cassandra
|
import salt.modules.cassandra as cassandra
|
||||||
|
|
||||||
|
|
||||||
@skipIf(NO_MOCK, NO_MOCK_REASON)
|
|
||||||
class CassandraTestCase(TestCase, LoaderModuleMockMixin):
|
class CassandraTestCase(TestCase, LoaderModuleMockMixin):
|
||||||
'''
|
'''
|
||||||
Test cases for salt.modules.cassandra
|
Test cases for salt.modules.cassandra
|
||||||
|
|
|
@ -7,19 +7,16 @@ from __future__ import absolute_import, print_function, unicode_literals
|
||||||
|
|
||||||
# Import Salt Testing Libs
|
# Import Salt Testing Libs
|
||||||
from tests.support.mixins import LoaderModuleMockMixin
|
from tests.support.mixins import LoaderModuleMockMixin
|
||||||
from tests.support.unit import TestCase, skipIf
|
from tests.support.unit import TestCase
|
||||||
from tests.support.mock import (
|
from tests.support.mock import (
|
||||||
MagicMock,
|
MagicMock,
|
||||||
patch,
|
patch,
|
||||||
NO_MOCK,
|
|
||||||
NO_MOCK_REASON
|
|
||||||
)
|
)
|
||||||
|
|
||||||
# Import Salt Libs
|
# Import Salt Libs
|
||||||
import salt.modules.chef as chef
|
import salt.modules.chef as chef
|
||||||
|
|
||||||
|
|
||||||
@skipIf(NO_MOCK, NO_MOCK_REASON)
|
|
||||||
class ChefTestCase(TestCase, LoaderModuleMockMixin):
|
class ChefTestCase(TestCase, LoaderModuleMockMixin):
|
||||||
'''
|
'''
|
||||||
Test cases for salt.modules.chef
|
Test cases for salt.modules.chef
|
||||||
|
|
|
@ -33,12 +33,7 @@ import sys
|
||||||
# Import Salt Testing Libs
|
# Import Salt Testing Libs
|
||||||
from tests.support.mixins import LoaderModuleMockMixin
|
from tests.support.mixins import LoaderModuleMockMixin
|
||||||
from tests.support.unit import skipIf, TestCase
|
from tests.support.unit import skipIf, TestCase
|
||||||
from tests.support.mock import (
|
from tests.support.mock import MagicMock, patch
|
||||||
MagicMock,
|
|
||||||
NO_MOCK,
|
|
||||||
NO_MOCK_REASON,
|
|
||||||
patch,
|
|
||||||
)
|
|
||||||
|
|
||||||
from salt.exceptions import CommandExecutionError
|
from salt.exceptions import CommandExecutionError
|
||||||
import salt.utils.platform
|
import salt.utils.platform
|
||||||
|
@ -46,7 +41,6 @@ import salt.modules.chroot as chroot
|
||||||
|
|
||||||
|
|
||||||
@skipIf(salt.utils.platform.is_windows(), 'This test cannot work on Windows')
|
@skipIf(salt.utils.platform.is_windows(), 'This test cannot work on Windows')
|
||||||
@skipIf(NO_MOCK, NO_MOCK_REASON)
|
|
||||||
class ChrootTestCase(TestCase, LoaderModuleMockMixin):
|
class ChrootTestCase(TestCase, LoaderModuleMockMixin):
|
||||||
'''
|
'''
|
||||||
Test cases for salt.modules.chroot
|
Test cases for salt.modules.chroot
|
||||||
|
|
|
@ -25,8 +25,6 @@ from tests.support.mock import (
|
||||||
mock_open,
|
mock_open,
|
||||||
Mock,
|
Mock,
|
||||||
MagicMock,
|
MagicMock,
|
||||||
NO_MOCK,
|
|
||||||
NO_MOCK_REASON,
|
|
||||||
patch
|
patch
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -69,7 +67,6 @@ class MockTimedProc(object):
|
||||||
return self._stderr
|
return self._stderr
|
||||||
|
|
||||||
|
|
||||||
@skipIf(NO_MOCK, NO_MOCK_REASON)
|
|
||||||
class CMDMODTestCase(TestCase, LoaderModuleMockMixin):
|
class CMDMODTestCase(TestCase, LoaderModuleMockMixin):
|
||||||
'''
|
'''
|
||||||
Unit tests for the salt.modules.cmdmod module
|
Unit tests for the salt.modules.cmdmod module
|
||||||
|
|
|
@ -8,12 +8,10 @@ from __future__ import absolute_import, print_function, unicode_literals
|
||||||
|
|
||||||
# Import Salt Testing Libs
|
# Import Salt Testing Libs
|
||||||
from tests.support.mixins import LoaderModuleMockMixin
|
from tests.support.mixins import LoaderModuleMockMixin
|
||||||
from tests.support.unit import TestCase, skipIf
|
from tests.support.unit import TestCase
|
||||||
from tests.support.mock import (
|
from tests.support.mock import (
|
||||||
MagicMock,
|
MagicMock,
|
||||||
patch,
|
patch,
|
||||||
NO_MOCK,
|
|
||||||
NO_MOCK_REASON
|
|
||||||
)
|
)
|
||||||
|
|
||||||
# Import Salt Libs
|
# Import Salt Libs
|
||||||
|
@ -21,7 +19,6 @@ import salt.modules.composer as composer
|
||||||
from salt.exceptions import CommandExecutionError, CommandNotFoundError, SaltInvocationError
|
from salt.exceptions import CommandExecutionError, CommandNotFoundError, SaltInvocationError
|
||||||
|
|
||||||
|
|
||||||
@skipIf(NO_MOCK, NO_MOCK_REASON)
|
|
||||||
class ComposerTestCase(TestCase, LoaderModuleMockMixin):
|
class ComposerTestCase(TestCase, LoaderModuleMockMixin):
|
||||||
'''
|
'''
|
||||||
Test cases for salt.modules.composer
|
Test cases for salt.modules.composer
|
||||||
|
|
|
@ -5,8 +5,8 @@ from __future__ import absolute_import, print_function, unicode_literals
|
||||||
|
|
||||||
# Import Salt Testing libs
|
# Import Salt Testing libs
|
||||||
from tests.support.mixins import LoaderModuleMockMixin
|
from tests.support.mixins import LoaderModuleMockMixin
|
||||||
from tests.support.unit import skipIf, TestCase
|
from tests.support.unit import TestCase
|
||||||
from tests.support.mock import NO_MOCK, NO_MOCK_REASON, patch
|
from tests.support.mock import patch
|
||||||
|
|
||||||
# Import Salt libs
|
# Import Salt libs
|
||||||
import salt.modules.config as config
|
import salt.modules.config as config
|
||||||
|
@ -17,7 +17,6 @@ DEFAULTS = {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@skipIf(NO_MOCK, NO_MOCK_REASON)
|
|
||||||
class TestModulesConfig(TestCase, LoaderModuleMockMixin):
|
class TestModulesConfig(TestCase, LoaderModuleMockMixin):
|
||||||
|
|
||||||
def setup_loader_modules(self):
|
def setup_loader_modules(self):
|
||||||
|
|
|
@ -8,14 +8,12 @@ from __future__ import absolute_import, print_function, unicode_literals
|
||||||
|
|
||||||
# Import Salt Testing Libs
|
# Import Salt Testing Libs
|
||||||
from tests.support.mixins import LoaderModuleMockMixin
|
from tests.support.mixins import LoaderModuleMockMixin
|
||||||
from tests.support.unit import skipIf, TestCase
|
from tests.support.unit import TestCase
|
||||||
from tests.support.mock import (
|
from tests.support.mock import (
|
||||||
Mock,
|
Mock,
|
||||||
MagicMock,
|
MagicMock,
|
||||||
mock_open,
|
mock_open,
|
||||||
patch,
|
patch,
|
||||||
NO_MOCK,
|
|
||||||
NO_MOCK_REASON
|
|
||||||
)
|
)
|
||||||
|
|
||||||
# Import Salt Libs
|
# Import Salt Libs
|
||||||
|
@ -27,7 +25,6 @@ import salt.modules.cp as cp
|
||||||
from salt.exceptions import CommandExecutionError
|
from salt.exceptions import CommandExecutionError
|
||||||
|
|
||||||
|
|
||||||
@skipIf(NO_MOCK, NO_MOCK_REASON)
|
|
||||||
class CpTestCase(TestCase, LoaderModuleMockMixin):
|
class CpTestCase(TestCase, LoaderModuleMockMixin):
|
||||||
'''
|
'''
|
||||||
TestCase for salt.modules.cp module
|
TestCase for salt.modules.cp module
|
||||||
|
|
|
@ -7,18 +7,15 @@ from __future__ import absolute_import, print_function, unicode_literals
|
||||||
|
|
||||||
# Import Salt Testing Libs
|
# Import Salt Testing Libs
|
||||||
from tests.support.mixins import LoaderModuleMockMixin
|
from tests.support.mixins import LoaderModuleMockMixin
|
||||||
from tests.support.unit import TestCase, skipIf
|
from tests.support.unit import TestCase
|
||||||
from tests.support.mock import (
|
from tests.support.mock import (
|
||||||
MagicMock,
|
MagicMock,
|
||||||
patch,
|
patch,
|
||||||
NO_MOCK,
|
|
||||||
NO_MOCK_REASON
|
|
||||||
)
|
)
|
||||||
# Import Salt Libs
|
# Import Salt Libs
|
||||||
import salt.modules.cpan as cpan
|
import salt.modules.cpan as cpan
|
||||||
|
|
||||||
|
|
||||||
@skipIf(NO_MOCK, NO_MOCK_REASON)
|
|
||||||
class CpanTestCase(TestCase, LoaderModuleMockMixin):
|
class CpanTestCase(TestCase, LoaderModuleMockMixin):
|
||||||
'''
|
'''
|
||||||
Test cases for salt.modules.cpan
|
Test cases for salt.modules.cpan
|
||||||
|
|
|
@ -8,8 +8,8 @@ from __future__ import absolute_import, unicode_literals, print_function
|
||||||
|
|
||||||
# Import Salt Testing libs
|
# Import Salt Testing libs
|
||||||
from tests.support.mixins import LoaderModuleMockMixin
|
from tests.support.mixins import LoaderModuleMockMixin
|
||||||
from tests.support.unit import TestCase, skipIf
|
from tests.support.unit import TestCase
|
||||||
from tests.support.mock import NO_MOCK, NO_MOCK_REASON, MagicMock, patch, call
|
from tests.support.mock import MagicMock, patch, call
|
||||||
|
|
||||||
# Import Salt libs
|
# Import Salt libs
|
||||||
import salt.modules.cron as cron
|
import salt.modules.cron as cron
|
||||||
|
@ -60,7 +60,6 @@ def write_crontab(*args, **kw):
|
||||||
return MagicMock()
|
return MagicMock()
|
||||||
|
|
||||||
|
|
||||||
@skipIf(NO_MOCK, NO_MOCK_REASON)
|
|
||||||
class CronTestCase(TestCase, LoaderModuleMockMixin):
|
class CronTestCase(TestCase, LoaderModuleMockMixin):
|
||||||
|
|
||||||
def setup_loader_modules(self):
|
def setup_loader_modules(self):
|
||||||
|
@ -878,7 +877,6 @@ class CronTestCase(TestCase, LoaderModuleMockMixin):
|
||||||
python_shell=False)
|
python_shell=False)
|
||||||
|
|
||||||
|
|
||||||
@skipIf(NO_MOCK, NO_MOCK_REASON)
|
|
||||||
class PsTestCase(TestCase, LoaderModuleMockMixin):
|
class PsTestCase(TestCase, LoaderModuleMockMixin):
|
||||||
|
|
||||||
def setup_loader_modules(self):
|
def setup_loader_modules(self):
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
|
|
||||||
# # Import Salt Testing libs
|
# # Import Salt Testing libs
|
||||||
# from tests.support.unit import skipIf, TestCase
|
# from tests.support.unit import skipIf, TestCase
|
||||||
# from tests.support.mock import NO_MOCK, NO_MOCK_REASON, MagicMock, patch
|
# from tests.support.mock import MagicMock, patch
|
||||||
|
|
||||||
# # Import salt libs
|
# # Import salt libs
|
||||||
# import salt.modules.cyg as cyg
|
# import salt.modules.cyg as cyg
|
||||||
|
@ -13,7 +13,6 @@
|
||||||
# cyg.__salt__ = {}
|
# cyg.__salt__ = {}
|
||||||
|
|
||||||
|
|
||||||
# @skipIf(NO_MOCK, NO_MOCK_REASON)
|
|
||||||
# class TestcygModule(TestCase):
|
# class TestcygModule(TestCase):
|
||||||
|
|
||||||
# def test__get_cyg_dir(self):
|
# def test__get_cyg_dir(self):
|
||||||
|
|
|
@ -8,12 +8,10 @@ from __future__ import absolute_import, print_function, unicode_literals
|
||||||
|
|
||||||
# Import Salt Testing Libs
|
# Import Salt Testing Libs
|
||||||
from tests.support.mixins import LoaderModuleMockMixin
|
from tests.support.mixins import LoaderModuleMockMixin
|
||||||
from tests.support.unit import TestCase, skipIf
|
from tests.support.unit import TestCase
|
||||||
from tests.support.mock import (
|
from tests.support.mock import (
|
||||||
MagicMock,
|
MagicMock,
|
||||||
patch,
|
patch,
|
||||||
NO_MOCK,
|
|
||||||
NO_MOCK_REASON
|
|
||||||
)
|
)
|
||||||
import os
|
import os
|
||||||
|
|
||||||
|
@ -22,7 +20,6 @@ import salt.modules.daemontools as daemontools
|
||||||
from salt.exceptions import CommandExecutionError
|
from salt.exceptions import CommandExecutionError
|
||||||
|
|
||||||
|
|
||||||
@skipIf(NO_MOCK, NO_MOCK_REASON)
|
|
||||||
class DaemontoolsTestCase(TestCase, LoaderModuleMockMixin):
|
class DaemontoolsTestCase(TestCase, LoaderModuleMockMixin):
|
||||||
'''
|
'''
|
||||||
Test cases for salt.modules.daemontools
|
Test cases for salt.modules.daemontools
|
||||||
|
|
|
@ -7,20 +7,17 @@ from __future__ import absolute_import, print_function, unicode_literals
|
||||||
|
|
||||||
# Import Salt Testing Libs
|
# Import Salt Testing Libs
|
||||||
from tests.support.mixins import LoaderModuleMockMixin
|
from tests.support.mixins import LoaderModuleMockMixin
|
||||||
from tests.support.unit import TestCase, skipIf
|
from tests.support.unit import TestCase
|
||||||
from tests.support.mock import (
|
from tests.support.mock import (
|
||||||
MagicMock,
|
MagicMock,
|
||||||
patch,
|
patch,
|
||||||
mock_open,
|
mock_open,
|
||||||
NO_MOCK,
|
|
||||||
NO_MOCK_REASON
|
|
||||||
)
|
)
|
||||||
|
|
||||||
# Import Salt Libs
|
# Import Salt Libs
|
||||||
import salt.modules.data as data
|
import salt.modules.data as data
|
||||||
|
|
||||||
|
|
||||||
@skipIf(NO_MOCK, NO_MOCK_REASON)
|
|
||||||
class DataTestCase(TestCase, LoaderModuleMockMixin):
|
class DataTestCase(TestCase, LoaderModuleMockMixin):
|
||||||
'''
|
'''
|
||||||
Test cases for salt.modules.data
|
Test cases for salt.modules.data
|
||||||
|
|
|
@ -20,8 +20,6 @@ from tests.support.mock import (
|
||||||
mock_open,
|
mock_open,
|
||||||
MagicMock,
|
MagicMock,
|
||||||
patch,
|
patch,
|
||||||
NO_MOCK,
|
|
||||||
NO_MOCK_REASON
|
|
||||||
)
|
)
|
||||||
|
|
||||||
# Import Salt Libs
|
# Import Salt Libs
|
||||||
|
@ -30,7 +28,6 @@ import salt.modules.ddns as ddns
|
||||||
|
|
||||||
|
|
||||||
@skipIf(HAS_DNS is False, 'dnspython libs not installed')
|
@skipIf(HAS_DNS is False, 'dnspython libs not installed')
|
||||||
@skipIf(NO_MOCK, NO_MOCK_REASON)
|
|
||||||
class DDNSTestCase(TestCase, LoaderModuleMockMixin):
|
class DDNSTestCase(TestCase, LoaderModuleMockMixin):
|
||||||
'''
|
'''
|
||||||
TestCase for the salt.modules.ddns module
|
TestCase for the salt.modules.ddns module
|
||||||
|
|
|
@ -8,12 +8,10 @@ from __future__ import absolute_import, print_function, unicode_literals
|
||||||
|
|
||||||
# Import Salt Testing Libs
|
# Import Salt Testing Libs
|
||||||
from tests.support.mixins import LoaderModuleMockMixin
|
from tests.support.mixins import LoaderModuleMockMixin
|
||||||
from tests.support.unit import TestCase, skipIf
|
from tests.support.unit import TestCase
|
||||||
from tests.support.mock import (
|
from tests.support.mock import (
|
||||||
MagicMock,
|
MagicMock,
|
||||||
patch,
|
patch,
|
||||||
NO_MOCK,
|
|
||||||
NO_MOCK_REASON
|
|
||||||
)
|
)
|
||||||
|
|
||||||
# Import Salt Libs
|
# Import Salt Libs
|
||||||
|
@ -21,7 +19,6 @@ import salt.modules.deb_apache as deb_apache
|
||||||
from salt.ext import six
|
from salt.ext import six
|
||||||
|
|
||||||
|
|
||||||
@skipIf(NO_MOCK, NO_MOCK_REASON)
|
|
||||||
class DebApacheTestCase(TestCase, LoaderModuleMockMixin):
|
class DebApacheTestCase(TestCase, LoaderModuleMockMixin):
|
||||||
'''
|
'''
|
||||||
Test cases for salt.modules.deb_apache
|
Test cases for salt.modules.deb_apache
|
||||||
|
|
|
@ -5,8 +5,8 @@ from __future__ import absolute_import, print_function, unicode_literals
|
||||||
|
|
||||||
# Import Salt Testing libs
|
# Import Salt Testing libs
|
||||||
from tests.support.mixins import LoaderModuleMockMixin
|
from tests.support.mixins import LoaderModuleMockMixin
|
||||||
from tests.support.unit import skipIf, TestCase
|
from tests.support.unit import TestCase
|
||||||
from tests.support.mock import NO_MOCK, NO_MOCK_REASON, Mock, patch
|
from tests.support.mock import Mock, patch
|
||||||
|
|
||||||
# Import salt libs
|
# Import salt libs
|
||||||
from salt.ext import six
|
from salt.ext import six
|
||||||
|
@ -20,7 +20,6 @@ LSCLUSTER = '''\
|
||||||
'''
|
'''
|
||||||
|
|
||||||
|
|
||||||
@skipIf(NO_MOCK, NO_MOCK_REASON)
|
|
||||||
class PostgresClusterTestCase(TestCase, LoaderModuleMockMixin):
|
class PostgresClusterTestCase(TestCase, LoaderModuleMockMixin):
|
||||||
|
|
||||||
def setup_loader_modules(self):
|
def setup_loader_modules(self):
|
||||||
|
@ -65,7 +64,6 @@ class PostgresClusterTestCase(TestCase, LoaderModuleMockMixin):
|
||||||
# datadir='/opt/postgresql'))
|
# datadir='/opt/postgresql'))
|
||||||
|
|
||||||
|
|
||||||
@skipIf(NO_MOCK, NO_MOCK_REASON)
|
|
||||||
class PostgresLsClusterTestCase(TestCase, LoaderModuleMockMixin):
|
class PostgresLsClusterTestCase(TestCase, LoaderModuleMockMixin):
|
||||||
|
|
||||||
def setup_loader_modules(self):
|
def setup_loader_modules(self):
|
||||||
|
@ -121,7 +119,6 @@ class PostgresLsClusterTestCase(TestCase, LoaderModuleMockMixin):
|
||||||
self.assertFalse(deb_postgres.cluster_exists('3.4', 'main'))
|
self.assertFalse(deb_postgres.cluster_exists('3.4', 'main'))
|
||||||
|
|
||||||
|
|
||||||
@skipIf(NO_MOCK, NO_MOCK_REASON)
|
|
||||||
class PostgresDeleteClusterTestCase(TestCase, LoaderModuleMockMixin):
|
class PostgresDeleteClusterTestCase(TestCase, LoaderModuleMockMixin):
|
||||||
|
|
||||||
def setup_loader_modules(self):
|
def setup_loader_modules(self):
|
||||||
|
|
|
@ -7,12 +7,10 @@ from __future__ import absolute_import, print_function, unicode_literals
|
||||||
|
|
||||||
# Import Salt Testing Libs
|
# Import Salt Testing Libs
|
||||||
from tests.support.mixins import LoaderModuleMockMixin
|
from tests.support.mixins import LoaderModuleMockMixin
|
||||||
from tests.support.unit import TestCase, skipIf
|
from tests.support.unit import TestCase
|
||||||
from tests.support.mock import (
|
from tests.support.mock import (
|
||||||
MagicMock,
|
MagicMock,
|
||||||
patch,
|
patch,
|
||||||
NO_MOCK,
|
|
||||||
NO_MOCK_REASON
|
|
||||||
)
|
)
|
||||||
|
|
||||||
# Import Salt Libs
|
# Import Salt Libs
|
||||||
|
@ -20,7 +18,6 @@ import salt.modules.debconfmod as debconfmod
|
||||||
import os
|
import os
|
||||||
|
|
||||||
|
|
||||||
@skipIf(NO_MOCK, NO_MOCK_REASON)
|
|
||||||
class DebconfmodTestCase(TestCase, LoaderModuleMockMixin):
|
class DebconfmodTestCase(TestCase, LoaderModuleMockMixin):
|
||||||
'''
|
'''
|
||||||
Test cases for salt.modules.DebconfmodTestCase
|
Test cases for salt.modules.DebconfmodTestCase
|
||||||
|
|
|
@ -13,8 +13,6 @@ from tests.support.unit import TestCase, skipIf
|
||||||
from tests.support.mock import (
|
from tests.support.mock import (
|
||||||
MagicMock,
|
MagicMock,
|
||||||
patch,
|
patch,
|
||||||
NO_MOCK,
|
|
||||||
NO_MOCK_REASON
|
|
||||||
)
|
)
|
||||||
|
|
||||||
# Import Salt Libs
|
# Import Salt Libs
|
||||||
|
@ -25,7 +23,6 @@ import salt.utils.platform
|
||||||
import jinja2.exceptions
|
import jinja2.exceptions
|
||||||
|
|
||||||
|
|
||||||
@skipIf(NO_MOCK, NO_MOCK_REASON)
|
|
||||||
@skipIf(salt.utils.platform.is_windows(), 'Do not run these tests on Windows')
|
@skipIf(salt.utils.platform.is_windows(), 'Do not run these tests on Windows')
|
||||||
class DebianIpTestCase(TestCase, LoaderModuleMockMixin):
|
class DebianIpTestCase(TestCase, LoaderModuleMockMixin):
|
||||||
'''
|
'''
|
||||||
|
|
|
@ -7,19 +7,16 @@ from __future__ import absolute_import, print_function, unicode_literals
|
||||||
|
|
||||||
# Import Salt Testing Libs
|
# Import Salt Testing Libs
|
||||||
from tests.support.mixins import LoaderModuleMockMixin
|
from tests.support.mixins import LoaderModuleMockMixin
|
||||||
from tests.support.unit import TestCase, skipIf
|
from tests.support.unit import TestCase
|
||||||
from tests.support.mock import (
|
from tests.support.mock import (
|
||||||
MagicMock,
|
MagicMock,
|
||||||
patch,
|
patch,
|
||||||
NO_MOCK,
|
|
||||||
NO_MOCK_REASON
|
|
||||||
)
|
)
|
||||||
|
|
||||||
# Import Salt Libs
|
# Import Salt Libs
|
||||||
import salt.modules.debian_service as debian_service
|
import salt.modules.debian_service as debian_service
|
||||||
|
|
||||||
|
|
||||||
@skipIf(NO_MOCK, NO_MOCK_REASON)
|
|
||||||
class DebianServicesTestCase(TestCase, LoaderModuleMockMixin):
|
class DebianServicesTestCase(TestCase, LoaderModuleMockMixin):
|
||||||
'''
|
'''
|
||||||
Test cases for salt.modules.debian_service
|
Test cases for salt.modules.debian_service
|
||||||
|
|
|
@ -8,19 +8,16 @@ import inspect
|
||||||
|
|
||||||
# Import Salt Testing Libs
|
# Import Salt Testing Libs
|
||||||
from tests.support.mixins import LoaderModuleMockMixin
|
from tests.support.mixins import LoaderModuleMockMixin
|
||||||
from tests.support.unit import TestCase, skipIf
|
from tests.support.unit import TestCase
|
||||||
from tests.support.mock import (
|
from tests.support.mock import (
|
||||||
MagicMock,
|
MagicMock,
|
||||||
patch,
|
patch,
|
||||||
NO_MOCK,
|
|
||||||
NO_MOCK_REASON
|
|
||||||
)
|
)
|
||||||
|
|
||||||
# Import Salt Libs
|
# Import Salt Libs
|
||||||
import salt.modules.defaults as defaults
|
import salt.modules.defaults as defaults
|
||||||
|
|
||||||
|
|
||||||
@skipIf(NO_MOCK, NO_MOCK_REASON)
|
|
||||||
class DefaultsTestCase(TestCase, LoaderModuleMockMixin):
|
class DefaultsTestCase(TestCase, LoaderModuleMockMixin):
|
||||||
'''
|
'''
|
||||||
Test cases for salt.modules.defaults
|
Test cases for salt.modules.defaults
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue