예제 #1
0
def _normalize_expected_result(expected_result):
    """
    Normalizes the expected result by replacing placeholders like <STAGING_DIR> with the actual directory name.
    """
    return normalize_structure(
        expected_result,
        _replace_staging_dir_placeholders,
    )
예제 #2
0
def _normalize_actual_result(result, base_path):
    """
    Normalizes the actual result by relativizing the absolute paths such that they can be compared with the
    necessarily relative paths in the expected result. The path separators are also normalized to '/'.
    """
    return normalize_structure(
        result,
        lambda item: remove_prefix(item, base_path),
        _normalize_path_separators,
    )
예제 #3
0
def normalize_unicode(actual_or_expected_result):
    return normalize_structure(
        actual_or_expected_result,
        lambda item: unicodedata.normalize('NFC', item),
    )
예제 #4
0
def _normalize_input_files(files_repr):
    return normalize_structure(
        files_repr,
        _replace_staging_dir_placeholders,
    )