diff options
author | Tim Harder <radhermit@gmail.com> | 2021-06-30 16:04:21 -0600 |
---|---|---|
committer | Tim Harder <radhermit@gmail.com> | 2021-06-30 16:04:21 -0600 |
commit | d363e027496f7902ebe1ef0bbe89ab2abd7840e4 (patch) | |
tree | 2daf1a759059f353ff53229495380558ce744da3 /tests | |
parent | pkgdev commit: use better variable name for footer values (diff) | |
download | pkgdev-d363e027496f7902ebe1ef0bbe89ab2abd7840e4.tar.gz pkgdev-d363e027496f7902ebe1ef0bbe89ab2abd7840e4.tar.bz2 pkgdev-d363e027496f7902ebe1ef0bbe89ab2abd7840e4.zip |
tests: add `pkgdev commit` non-generated message test
Diffstat (limited to 'tests')
-rw-r--r-- | tests/scripts/test_pkgdev_commit.py | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/tests/scripts/test_pkgdev_commit.py b/tests/scripts/test_pkgdev_commit.py index d93df7a..833125d 100644 --- a/tests/scripts/test_pkgdev_commit.py +++ b/tests/scripts/test_pkgdev_commit.py @@ -518,7 +518,7 @@ class TestPkgdevCommit: shutil.rmtree(pjoin(git_repo.path, 'newcat/pkg')) assert commit() == 'newcat/pkg: treeclean' - def test_footer_with_no_summary(self, capsys, repo, make_git_repo): + def test_no_summary(self, capsys, repo, make_git_repo): git_repo = make_git_repo(repo.location) repo.create_ebuild('cat/pkg-0') git_repo.add_all('cat/pkg-0') @@ -534,8 +534,15 @@ class TestPkgdevCommit: assert err == out == '' return git_repo.log(['-1', '--pretty=tformat:%B', 'HEAD']) + # no commit message content for i in range(10): - with open(pjoin(git_repo.path, f'file{i}'), 'w') as f: + with open(pjoin(git_repo.path, f'file-a-{i}'), 'w') as f: + f.write('stub\n') + assert commit(['-a']) == ['summary'] + + # footer exists with no generated summary + for i in range(10): + with open(pjoin(git_repo.path, f'file-b-{i}'), 'w') as f: f.write('stub\n') assert commit(['-a', '-T', 'tag:value']) == ['summary', '', 'Tag: value'] |