def program_dependent(program_name, *program_names):
<EOL>import subprocess<EOL>import errno<EOL>def _test(name):<EOL><INDENT>command = program_tests[name]<EOL>with open(os.devnull, '<STR_LIT:wb>') as DEVNULL:<EOL><INDENT>try:<EOL><INDENT>subprocess.check_call(command, stdout=DEVNULL, stderr=DEVNULL)<EOL><DEDENT>except (OSError, IOError, subprocess.CalledProcessError):<EOL><INDENT>return False<EOL><DEDENT>else:<EOL><INDENT>return True<EOL><DEDENT><DEDENT><DEDENT>names = [program_name] + list(program_names)<EOL>exists = all(_test(x) for x in names)<EOL>if exists:<EOL><INDENT>def wrapper(fn):<EOL><INDENT>return fn<EOL><DEDENT><DEDENT>else:<EOL><INDENT>def wrapper(fn):<EOL><INDENT>return unittest.skip("<STR_LIT>" % names)(fn)<EOL><DEDENT><DEDENT>return wrapper<EOL>
Function decorator that skips the function if not all given programs are
    visible.