mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Update test mocks for cmd.run_all dicts
This commit is contained in:
parent
3904dfc5a8
commit
a828bdd0b8
1 changed files with 9 additions and 6 deletions
|
@ -59,24 +59,27 @@ class HgTestCase(TestCase):
|
|||
'''
|
||||
Test for Perform a pull on the given repository
|
||||
'''
|
||||
with patch.dict(hg.__salt__, {'cmd.run':
|
||||
MagicMock(return_value='A')}):
|
||||
with patch.dict(hg.__salt__, {'cmd.run_all':
|
||||
MagicMock(return_value={'retcode': 0,
|
||||
'stdout': 'A'})}):
|
||||
self.assertEqual(hg.pull('cwd'), 'A')
|
||||
|
||||
def test_update(self):
|
||||
'''
|
||||
Test for Update to a given revision
|
||||
'''
|
||||
with patch.dict(hg.__salt__, {'cmd.run':
|
||||
MagicMock(return_value='A')}):
|
||||
with patch.dict(hg.__salt__, {'cmd.run_all':
|
||||
MagicMock(return_value={'retcode': 0,
|
||||
'stdout': 'A'})}):
|
||||
self.assertEqual(hg.update('cwd', 'rev'), 'A')
|
||||
|
||||
def test_clone(self):
|
||||
'''
|
||||
Test for Clone a new repository
|
||||
'''
|
||||
with patch.dict(hg.__salt__, {'cmd.run':
|
||||
MagicMock(return_value='A')}):
|
||||
with patch.dict(hg.__salt__, {'cmd.run_all':
|
||||
MagicMock(return_value={'retcode': 0,
|
||||
'stdout': 'A'})}):
|
||||
self.assertEqual(hg.clone('cwd', 'repository'), 'A')
|
||||
|
||||
def test_status_single(self):
|
||||
|
|
Loading…
Add table
Reference in a new issue