예제 #1
0
파일: test_hg.py 프로젝트: stianvi/git-lint
 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
파일: test_hg.py 프로젝트: stianvi/git-lint
 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}'])