コード例 #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
ファイル: test_hg.py プロジェクト: AndreaCrotti/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())
コード例 #6
0
ファイル: test_hg.py プロジェクト: AndreaCrotti/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}'])