mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Implement test for the upgrade_available
This commit is contained in:
parent
ad87e719d6
commit
90f209569a
1 changed files with 12 additions and 0 deletions
|
@ -218,6 +218,18 @@ class ZypperTestCase(TestCase):
|
|||
with patch.dict(zypper.__salt__, {'cmd.run_stdout': MagicMock(return_value=ref_out)}):
|
||||
assert(zypper.latest_version('vim') == '7.4.326-2.62')
|
||||
|
||||
@patch('salt.modules.zypper.refresh_db', MagicMock(return_value=True))
|
||||
def test_upgrade_available(self):
|
||||
'''
|
||||
Test whether or not an upgrade is available for a given package.
|
||||
|
||||
:return:
|
||||
'''
|
||||
ref_out = get_test_data('zypper-available.txt')
|
||||
with patch.dict(zypper.__salt__, {'cmd.run_stdout': MagicMock(return_value=ref_out)}):
|
||||
assert(not zypper.upgrade_available('emacs'))
|
||||
assert(zypper.upgrade_available('vim'))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
from integration import run_tests
|
||||
|
|
Loading…
Add table
Reference in a new issue