diff options
author | Tim Harder <radhermit@gmail.com> | 2021-06-30 15:54:57 -0600 |
---|---|---|
committer | Tim Harder <radhermit@gmail.com> | 2021-06-30 15:56:15 -0600 |
commit | bd57697dcfd33595214104074470bc84023d9518 (patch) | |
tree | 0f1283568ea983ddd3c8d19bb44fb21c33dca859 /tests | |
parent | pkgdev commit: properly generate pkg rename summaries (diff) | |
download | pkgdev-bd57697dcfd33595214104074470bc84023d9518.tar.gz pkgdev-bd57697dcfd33595214104074470bc84023d9518.tar.bz2 pkgdev-bd57697dcfd33595214104074470bc84023d9518.zip |
tests: add `pkgdev commit` check for footer with no generated summary
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') |