mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 08:58:59 +00:00
Adapted unit.modules.archive_test
to use salttesting.mock
This commit is contained in:
parent
8646fcb012
commit
2acd67bc59
@ -11,23 +11,17 @@
|
||||
# Import Salt Testing libs
|
||||
from salttesting import skipIf, TestCase
|
||||
from salttesting.helpers import ensure_in_syspath
|
||||
from salttesting.mock import NO_MOCK, NO_MOCK_REASON, MagicMock, patch
|
||||
ensure_in_syspath('../../')
|
||||
|
||||
# Import salt libs
|
||||
from salt.modules import archive
|
||||
from salt.exceptions import CommandNotFoundError
|
||||
|
||||
# Import 3rd party libs
|
||||
try:
|
||||
from mock import MagicMock, patch
|
||||
HAS_MOCK = True
|
||||
except ImportError:
|
||||
HAS_MOCK = False
|
||||
|
||||
archive.__salt__ = {}
|
||||
|
||||
|
||||
@skipIf(HAS_MOCK is False, 'mock python module is unavailable')
|
||||
@skipIf(NO_MOCK, NO_MOCK_REASON)
|
||||
class ArchiveTestCase(TestCase):
|
||||
|
||||
@patch('salt.utils.which', lambda exe: exe)
|
||||
|
Loading…
Reference in New Issue
Block a user