Пример #1
0
 def test_last_commit_not_in_repo(self):
     with mock.patch('subprocess.check_output',
                     side_effect=subprocess.CalledProcessError(255, '',
                                                               '')):
         self.assertEqual(None, hg.last_commit())
Пример #2
0
 def test_last_commit(self):
     with mock.patch('subprocess.check_output',
                     return_value=b'0a' * 20 + b'\n') as hg_call:
         self.assertEqual('0a' * 20, hg.last_commit())
         hg_call.asser_called_once_with(
             ['hg', 'parent', '--template={node}'])
Пример #3
0
 def test_last_commit_not_in_repo(self, check_output):
     check_output.side_effect = subprocess.CalledProcessError(255, '', '')
     self.assertEqual(None, hg.last_commit())
Пример #4
0
 def test_last_commit(self, check_output):
     self.assertEqual('0a' * 20, hg.last_commit())
     check_output.assert_called_once_with(
         ['hg', 'parent', '--template={node}'], stderr=subprocess.STDOUT)
Пример #5
0
 def test_last_commit_not_in_repo(self):
     with mock.patch('subprocess.check_output',
                     side_effect=subprocess.CalledProcessError(255, '', '')):
         self.assertEqual(None, hg.last_commit())
Пример #6
0
 def test_last_commit(self):
     with mock.patch('subprocess.check_output',
                     return_value=b'0a' * 20 + b'\n') as hg_call:
         self.assertEqual('0a' * 20, hg.last_commit())
         hg_call.asser_called_once_with(
             ['hg', 'parent', '--template={node}'])