diff options
Diffstat (limited to 'test/lib/ansible_test/_internal/coverage/analyze/targets/expand.py')
-rw-r--r-- | test/lib/ansible_test/_internal/coverage/analyze/targets/expand.py | 21 |
1 files changed, 1 insertions, 20 deletions
diff --git a/test/lib/ansible_test/_internal/coverage/analyze/targets/expand.py b/test/lib/ansible_test/_internal/coverage/analyze/targets/expand.py index 536a877d70..db054a8ed3 100644 --- a/test/lib/ansible_test/_internal/coverage/analyze/targets/expand.py +++ b/test/lib/ansible_test/_internal/coverage/analyze/targets/expand.py @@ -11,6 +11,7 @@ from ....io import ( from . import ( CoverageAnalyzeTargetsConfig, + expand_indexes, format_arc, read_report, ) @@ -29,26 +30,6 @@ def command_coverage_analyze_targets_expand(args): # type: (CoverageAnalyzeTarg write_json_file(args.output_file, report, encoder=SortedSetEncoder) -def expand_indexes( - source_data, # type: t.Dict[str, t.Dict[t.Any, t.Set[int]]] - source_index, # type: t.List[str] - format_func, # type: t.Callable[t.Tuple[t.Any], str] -): # type: (...) -> t.Dict[str, t.Dict[t.Any, t.Set[str]]] - """Merge indexes from the source into the combined data set (arcs or lines).""" - combined_data = {} # type: t.Dict[str, t.Dict[t.Any, t.Set[str]]] - - for covered_path, covered_points in source_data.items(): - combined_points = combined_data.setdefault(covered_path, {}) - - for covered_point, covered_target_indexes in covered_points.items(): - combined_point = combined_points.setdefault(format_func(covered_point), set()) - - for covered_target_index in covered_target_indexes: - combined_point.add(source_index[covered_target_index]) - - return combined_data - - class CoverageAnalyzeTargetsExpandConfig(CoverageAnalyzeTargetsConfig): """Configuration for the `coverage analyze targets expand` command.""" def __init__(self, args): # type: (t.Any) -> None |