Adapted unit.modules.archive_test to use salttesting.mock

This commit is contained in:
Pedro Algarvio 2013-08-26 09:45:22 +00:00
parent 8646fcb012
commit 2acd67bc59

View File

@ -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)