def test_paginator_not_available(self): """Check that without paginator command we proceed without changes""" std = output.StdOutput() with unittest.mock.patch('avocado.utils.path.find_command', side_effect=utils_path.CmdNotFoundError( 'just', ['mocking'])): std.enable_paginator() self.assertEqual(self.stdout, sys.stdout) self.assertEqual(self.stderr, sys.stderr)
def mock_fail_find_cmd(cmd, default=None, check_exec=True): # pylint: disable=W0613 path_paths = [ "/usr/libexec", "/usr/local/sbin", "/usr/local/bin", "/usr/sbin", "/usr/bin", "/sbin", "/bin", ] raise path.CmdNotFoundError(cmd, path_paths)
def mock_fail_find_cmd(cmd, default=None): path_paths = ["/usr/libexec", "/usr/local/sbin", "/usr/local/bin", "/usr/sbin", "/usr/bin", "/sbin", "/bin"] raise path.CmdNotFoundError(cmd, path_paths)