コード例 #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
ファイル: test_scan_files.py プロジェクト: goc9000/baon
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,
    )