def check_files(test_dir, expected):
    '\n    Walk test_dir.\n    Check that all dirs are readable.\n    Check that all files are:\n     * non-special,\n     * readable,\n     * have a posix path that ends with one of the expected tuple paths.\n    '
    result = []
    locs = []
    if filetype.is_file(test_dir):
        test_dir = fileutils.parent_directory(test_dir)
    test_dir_path = fileutils.as_posixpath(test_dir)
    for (top, _, files) in os.walk(test_dir):
        for f in files:
            location = os.path.join(top, f)
            locs.append(location)
            path = fileutils.as_posixpath(location)
            path = path.replace(test_dir_path, '').strip('/')
            result.append(path)
    assert (sorted(expected) == sorted(result))
    for location in locs:
        assert filetype.is_file(location)
        assert (not filetype.is_special(location))
        assert filetype.is_readable(location)
Walk test_dir.
Check that all dirs are readable.
Check that all files are:
 * non-special,
 * readable,
 * have a posix path that ends with one of the expected tuple paths.
def check_files(test_dir, expected):
    '\n    Walk test_dir.\n    Check that all dirs are readable.\n    Check that all files are:\n     * non-special,\n     * readable,\n     * have a posix path that ends with one of the expected tuple paths.\n    '
    result = []
    locs = []
    if filetype.is_file(test_dir):
        test_dir = fileutils.parent_directory(test_dir)
    test_dir_path = fileutils.as_posixpath(test_dir)
    for (top, _, files) in os.walk(test_dir):
        for f in files:
            location = os.path.join(top, f)
            locs.append(location)
            path = fileutils.as_posixpath(location)
            path = path.replace(test_dir_path, ).strip('/')
            result.append(path)
    assert (sorted(expected) == sorted(result))
    for location in locs:
        assert filetype.is_file(location)
        assert (not filetype.is_special(location))
        assert filetype.is_readable(location)