mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 08:58:59 +00:00
Implement list upgrades test
This commit is contained in:
parent
8862d7af65
commit
3342c03987
@ -42,6 +42,26 @@ class ZypperTestCase(TestCase):
|
||||
Test cases for salt.modules.zypper
|
||||
'''
|
||||
|
||||
def test_list_upgrades(self):
|
||||
'''
|
||||
List package upgrades
|
||||
:return:
|
||||
'''
|
||||
ref_out = {
|
||||
'stdout': get_test_data('zypper-updates.xml'),
|
||||
'stderr': None,
|
||||
'retcode': 0
|
||||
}
|
||||
with patch.dict(zypper.__salt__, {'cmd.run_all': MagicMock(return_value=ref_out)}):
|
||||
upgrades = zypper.list_upgrades(refresh=False)
|
||||
assert(len(upgrades) == 3)
|
||||
for pkg, version in {'SUSEConnect': '0.2.33-7.1',
|
||||
'bind-utils': '9.9.6P1-35.1',
|
||||
'bind-libs': '9.9.6P1-35.1'}.items():
|
||||
assert(pkg in upgrades)
|
||||
assert(upgrades[pkg] == version)
|
||||
|
||||
|
||||
def test_list_upgrades_error_handling(self):
|
||||
'''
|
||||
Test error handling in the list package upgrades.
|
||||
|
Loading…
Reference in New Issue
Block a user