Example #1
0
 def test_update(self):
     '''
     Test for Update to a given revision
     '''
     with patch.dict(hg.__salt__, {'cmd.run':
                                     MagicMock(return_value='A')}):
         self.assertEqual(hg.update('cwd', 'rev'), 'A')
Example #2
0
 def test_update(self):
     '''
     Test for Update to a given revision
     '''
     with patch.object(hg, '_check_hg', return_value=None):
         with patch.dict(hg.__salt__,
                         {'cmd.run': MagicMock(return_value='A')}):
             self.assertEqual(hg.update('cwd', 'rev'), 'A')
Example #3
0
 def test_update(self):
     '''
     Test for Update to a given revision
     '''
     with patch.dict(hg.__salt__, {'cmd.run_all':
                                   MagicMock(return_value={'retcode': 0,
                                                           'stdout': 'A'})}):
         self.assertEqual(hg.update('cwd', 'rev'), 'A')
Example #4
0
 def test_update(self):
     """
     Test for Update to a given revision
     """
     with patch.dict(
             hg.__salt__,
         {
             "cmd.run_all":
             MagicMock(return_value={
                 "retcode": 0,
                 "stdout": "A"
             })
         },
     ):
         self.assertEqual(hg.update("cwd", "rev"), "A")