Example #1
0
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
Example #2
0
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
Example #3
0
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
Example #4
0
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