def test_with_dates(path_to_repo, filepath, since, to, expected_count):
    metric = LinesCount(path_to_repo=path_to_repo, since=since, to=to)

    actual_count = metric.count()
    filepath = str(Path(filepath))

    assert actual_count[filepath] == expected_count
Beispiel #2
0
def test(path_to_repo, filepath, from_commit, to_commit, expected):
    metric = LinesCount(path_to_repo=path_to_repo,
                        from_commit=from_commit,
                        to_commit=to_commit)

    count = metric.count()
    filepath = str(Path(filepath))
    assert count[filepath] == expected
def test_with_commits(path_to_repo, filepath, from_commit, to_commit,
                      expected_count):
    metric = LinesCount(path_to_repo=path_to_repo,
                        from_commit=from_commit,
                        to_commit=to_commit)

    actual_count = metric.count()
    filepath = str(Path(filepath))

    assert actual_count[filepath] == expected_count