def skipUnlessHasTestFile(path_segments):  
fail_unless_has_test_file = getattr(<EOL>unittest, '<STR_LIT>', False)<EOL>path = os.path.join('<STR_LIT>', *path_segments)<EOL>if fail_unless_has_test_file or os.path.exists(path):<EOL><INDENT>return lambda function: function<EOL><DEDENT>if sys.version_info[<NUM_LIT:0>] < <NUM_LIT:3>:<EOL><INDENT>path = path.encode('<STR_LIT:utf-8>')<EOL><DEDENT>return unittest.skip('<STR_LIT>'.format(path))<EOL>
Decorator to skip a test if the test file does not exist.

    Args:
      path_segments (list[str]): path segments inside the test data directory.

    Returns:
      function: to invoke.