From dacca59e1a968f79253dca901e212e868954fcff Mon Sep 17 00:00:00 2001 From: Guido Günther Date: Sat, 24 Nov 2018 17:17:10 +0100 Subject: pristine-tar: support checking in/out upstream signatures --- tests/doctests/test_PristineTar.py | 39 +++++++++++++++++++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) (limited to 'tests/doctests/test_PristineTar.py') diff --git a/tests/doctests/test_PristineTar.py b/tests/doctests/test_PristineTar.py index 3616319b..825ef042 100644 --- a/tests/doctests/test_PristineTar.py +++ b/tests/doctests/test_PristineTar.py @@ -76,7 +76,7 @@ def test_commit_dir(): def test_create_tarball(): """ - Create a tarball from a git tree + Create a tarball from a git tree and add a stub signature Methods tested: - L{gbp.deb.git.DebianGitRepository.archive} @@ -85,6 +85,8 @@ def test_create_tarball(): >>> repo = gbp.deb.git.DebianGitRepository(dirs['repo']) >>> repo.archive('tar', 'upstream/', '../upstream_1.0.orig.tar', 'upstream') >>> gbp.command_wrappers.Command('gzip', [ '-n', '%s/../upstream_1.0.orig.tar' % dirs['repo']])() + >>> with open('%s/../upstream_1.0.orig.tar.gz.asc' % dirs['repo'], 'w') as f: f.write("sig") + 3 """ @@ -101,6 +103,20 @@ def test_pristine_tar_commit(): """ +def test_pristine_tar_commit_with_sig(): + """ + Commit the delta to the pristine-tar branch including a signature + + Methods tested: + - L{gbp.deb.pristinetar.DebianPristineTar.commit} + + >>> import gbp.deb.git + >>> repo = gbp.deb.git.DebianGitRepository(dirs['repo']) + >>> repo.pristine_tar.commit('../upstream_1.0.orig.tar.gz', 'upstream', + ... signaturefile='../upstream_1.0.orig.tar.gz.asc') + """ + + def test_pristine_has_commit(): """ Find delta on the pristine tar branch @@ -137,6 +153,27 @@ def test_pristine_tar_checkout(): """ +def test_pristine_tar_checkout_with_sig(): + """ + Checkout a tarball using pristine-tar + + Methods tested: + - L{gbp.deb.pristinetar.DebianPristineTar.checkout} + + >>> import gbp.deb.git + >>> from gbp.deb.policy import DebianPkgPolicy + + >>> repo = gbp.deb.git.DebianGitRepository(dirs['repo']) + >>> sf = os.path.join(repo.path, + ... DebianPkgPolicy.build_signature_name('upstream', '1.0', 'gzip', '..')) + >>> os.unlink(sf) + >>> repo.pristine_tar.checkout('upstream', '1.0', 'gzip', '..', + ... signature=True) + >>> os.path.exists(sf) + True + """ + + def test_pristine_tar_verify(): """ Verify a tarball using pristine-tar -- cgit v1.2.3