my.coding.commits: actually test on CI, add config stub
This commit is contained in:
parent
8d6f691824
commit
ec8b0e9170
5 changed files with 47 additions and 6 deletions
|
@ -1,8 +1,36 @@
|
|||
from .common import skip_if_not_karlicoss as pytestmark
|
||||
# TODO need fdfind on CI?
|
||||
from pathlib import Path
|
||||
|
||||
from more_itertools import bucket
|
||||
import pytest
|
||||
|
||||
from more_itertools import ilen
|
||||
|
||||
def test() -> None:
|
||||
from my.coding.commits import commits
|
||||
all_commits = commits()
|
||||
assert ilen(all_commits) > 10
|
||||
all_commits = list(commits())
|
||||
assert len(all_commits) > 100
|
||||
|
||||
buckets = bucket(all_commits, key=lambda c: c.repo)
|
||||
by_repo = {k: list(buckets[k]) for k in buckets}
|
||||
# handle later
|
||||
|
||||
|
||||
@pytest.fixture(autouse=True)
|
||||
def prepare(tmp_path: Path):
|
||||
# TODO maybe test against actual testdata, could check for
|
||||
# - datetime handling
|
||||
# - bare repos
|
||||
# - canonical name
|
||||
# - caching?
|
||||
hpi_repo_root = Path(__file__).absolute().parent.parent
|
||||
assert (hpi_repo_root / '.git').exists(), hpi_repo_root
|
||||
|
||||
class commits:
|
||||
emails = {'karlicoss@gmail.com'}
|
||||
names = {'Dima'}
|
||||
roots = [hpi_repo_root]
|
||||
|
||||
from my.core.cfg import tmp_config
|
||||
with tmp_config() as config:
|
||||
config.commits = commits
|
||||
yield
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue