コード例 #1
0
ファイル: execution_tests.py プロジェクト: jcalta/committer
    def test_should_return_false_when_trying_to_execute_command_fails(self):
        when(execution).check_call(ANY_ARGUMENTS).then_raise(OSError())

        actual_result = check_if_is_executable('command', '--version', '--quiet')

        self.assertFalse(actual_result)
        verify(execution).check_call(['command', '--version', '--quiet'])
コード例 #2
0
ファイル: execution_tests.py プロジェクト: jcalta/committer
    def test_should_return_false_when_command_is_not_executable(self):
        when(execution).check_call(ANY_ARGUMENTS).then_raise(subprocess.CalledProcessError(127, 'command'))

        actual_result = check_if_is_executable('command', '--version', '--quiet')

        self.assertFalse(actual_result)
        verify(execution).check_call(['command', '--version', '--quiet'])
コード例 #3
0
ファイル: execution_tests.py プロジェクト: jcalta/committer
    def test_should_return_true_when_command_is_executable(self):
        when(execution).check_call(ANY_ARGUMENTS).then_return(None)

        actual_result = check_if_is_executable('command', '--version', '--quiet')

        self.assertTrue(actual_result)
        verify(execution).check_call(['command', '--version', '--quiet'])
コード例 #4
0
ファイル: subversion.py プロジェクト: amrx101/committer
    def is_executable(self):
        """
            Checks if svn client is executable.

            @return: True if "svn --version --quiet" is executable,
                     False otherwise.
        """
        return check_if_is_executable(self.command, '--version', '--quiet')
コード例 #5
0
    def is_executable(self):
        """
            Checks if svn client is executable.

            @return: True if "svn --version --quiet" is executable,
                     False otherwise.
        """
        return check_if_is_executable(self.command, '--version', '--quiet')
コード例 #6
0
ファイル: git.py プロジェクト: jcalta/committer
    def is_executable(self):
        """
            Checks if the git command line client is executable.

            @return: True if "git --version" is executable,
                     False otherwise.
        """
        return check_if_is_executable(self.command, '--version')
コード例 #7
0
ファイル: git.py プロジェクト: xixilog/python-printer-escpos
    def is_executable(self):
        """
            Checks if the git command line client is executable.

            @return: True if "git --version" is executable,
                     False otherwise.
        """
        return check_if_is_executable(self.command, '--version')
コード例 #8
0
ファイル: mercurial.py プロジェクト: jcalta/committer
 def is_executable(self):
     """
         @return: True if "hg --version --quiet" is executable,
                  False otherwise.
     """
     return check_if_is_executable(self.command, '--version', '--quiet')
コード例 #9
0
 def is_executable(self):
     """
         @return: True if "hg --version --quiet" is executable,
                  False otherwise.
     """
     return check_if_is_executable(self.command, '--version', '--quiet')