diff options
author | Tim Harder <radhermit@gmail.com> | 2021-03-11 21:03:38 -0700 |
---|---|---|
committer | Tim Harder <radhermit@gmail.com> | 2021-03-11 21:03:38 -0700 |
commit | 74eb62a4aeb930e9f5fd2834e439580338d2ad84 (patch) | |
tree | cf06c229de3f960f94b7a25326359ea59a230644 /tests | |
parent | replace --ignore-failures with -A/--ask option (diff) | |
download | pkgdev-74eb62a4aeb930e9f5fd2834e439580338d2ad84.tar.gz pkgdev-74eb62a4aeb930e9f5fd2834e439580338d2ad84.tar.bz2 pkgdev-74eb62a4aeb930e9f5fd2834e439580338d2ad84.zip |
tests: verify signed commit support for `pkgdev commit`
Diffstat (limited to 'tests')
-rw-r--r-- | tests/scripts/test_pkgdev_commit.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/scripts/test_pkgdev_commit.py b/tests/scripts/test_pkgdev_commit.py index 43c9666..974e2c4 100644 --- a/tests/scripts/test_pkgdev_commit.py +++ b/tests/scripts/test_pkgdev_commit.py @@ -49,6 +49,23 @@ class TestPkgdevCommitParseArgs: out, err = capsys.readouterr() assert err.strip() == 'pkgdev commit: error: not in ebuild git repo' + def test_commit_signing(self, repo, make_git_repo, tool): + git_repo = make_git_repo(repo.location) + repo.create_ebuild('cat/pkg-0') + git_repo.add_all('cat/pkg-0', commit=False) + # signed commits aren't enabled by default + with chdir(repo.location): + options, _ = tool.parse_args(['commit', '-u']) + assert '--signoff' not in options.commit_args + assert '--gpg-sign' not in options.commit_args + # signed commits enabled by layout.conf setting + with open(pjoin(git_repo.path, 'metadata/layout.conf'), 'a+') as f: + f.write('sign-commits = true\n') + with chdir(repo.location): + options, _ = tool.parse_args(['commit', '-u']) + assert '--signoff' in options.commit_args + assert '--gpg-sign' in options.commit_args + def test_git_commit_args(self, repo, make_git_repo, tool): git_repo = make_git_repo(repo.location) repo.create_ebuild('cat/pkg-0') |