def test_run_simple_failure(self): # command_simple should fail self.subproc_mock.returncode = 127 self._mock_communicate.return_value = self.subproc_mock # Create an implementation of BaseQualityReporter and explicitly call _run_command_simple bad_command = run_command_for_code('foo') # pylint: disable=protected-access self.assertEquals(bad_command, 127)
def installed(self): """ Method checks if the provided tool is installed. Returns: boolean True if installed """ return run_command_for_code(self.command_to_check_install) == 0
def test_run_simple_success(self): self.subproc_mock.returncode = 0 self._mock_communicate.return_value = self.subproc_mock # Create an implementation of BaseQualityReporter and explicitly call _run_command_simple good_command = run_command_for_code('foo') # pylint: disable=protected-access self.assertEquals(good_command, 0)
def installed(self): """ Override base method. Confirm the tool is installed by running this command and getting exit 0. Otherwise, raise an Environment Error. """ return run_command_for_code([self.command[0], '-v']) == 0