def test_get_metrics_inner_first_commit(cloneable_with_commits): repo_parser = GitRepoParser(cloneable_with_commits.path) with repo_parser.repo_checked_out(): metrics = _get_metrics_inner(( None, cloneable_with_commits.commits[0], repo_parser, {LinesOfCodeParser}, re.compile(b'^$'), )) assert Metric(name='TotalLinesOfCode', value=0) in metrics
def test_get_metrics_inner_first_commit(cloneable_with_commits): repo_parser = RepoParser(cloneable_with_commits.path) with repo_parser.repo_checked_out(): metrics = _get_metrics_inner(( None, cloneable_with_commits.commits[0], repo_parser, [LinesOfCodeParser], re.compile(b'^$'), )) assert Metric(name='TotalLinesOfCode', value=0) in metrics
def test_get_metrics_inner_nth_commit(cloneable_with_commits): repo_parser = RepoParser(cloneable_with_commits.path) with repo_parser.repo_checked_out(): metrics = _get_metrics_inner(( cloneable_with_commits.commits[-2], cloneable_with_commits.commits[-1], repo_parser, [LinesOfCodeParser], )) assert Metric(name='TotalLinesOfCode', value=2) in metrics