diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/scripts/test_pkgdev_commit.py | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/scripts/test_pkgdev_commit.py b/tests/scripts/test_pkgdev_commit.py index 19e1938..d93df7a 100644 --- a/tests/scripts/test_pkgdev_commit.py +++ b/tests/scripts/test_pkgdev_commit.py @@ -518,6 +518,27 @@ 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): + git_repo = make_git_repo(repo.location) + repo.create_ebuild('cat/pkg-0') + git_repo.add_all('cat/pkg-0') + + def commit(args): + with os_environ(GIT_EDITOR="sed -i '1s/$/summary/'"), \ + patch('sys.argv', self.args + args), \ + pytest.raises(SystemExit) as excinfo, \ + chdir(git_repo.path): + self.script() + assert excinfo.value.code == 0 + out, err = capsys.readouterr() + assert err == out == '' + return git_repo.log(['-1', '--pretty=tformat:%B', 'HEAD']) + + for i in range(10): + with open(pjoin(git_repo.path, f'file{i}'), 'w') as f: + f.write('stub\n') + assert commit(['-a', '-T', 'tag:value']) == ['summary', '', 'Tag: value'] + def test_non_gentoo_file_mangling(self, repo, make_git_repo): git_repo = make_git_repo(repo.location) ebuild_path = repo.create_ebuild('cat/pkg-0') |