diff options
author | Guido Günther <agx@sigxcpu.org> | 2017-01-20 11:31:38 +0100 |
---|---|---|
committer | Guido Günther <agx@sigxcpu.org> | 2017-01-20 11:57:03 +0100 |
commit | 1bce6428cff7c2c8788e07165dc3c4df2b69c3c8 (patch) | |
tree | 4bf23d3047cfac7d0e63384faf2a4da3125abcf9 | |
parent | ca7d38746546f97436353fcf74e53926fb4c2cc7 (diff) |
PristineTar: add verify
-rw-r--r-- | gbp/pkg/pristinetar.py | 6 | ||||
-rw-r--r-- | tests/doctests/test_PristineTar.py | 13 |
2 files changed, 19 insertions, 0 deletions
diff --git a/gbp/pkg/pristinetar.py b/gbp/pkg/pristinetar.py index 79e1334e..bb84a2fc 100644 --- a/gbp/pkg/pristinetar.py +++ b/gbp/pkg/pristinetar.py @@ -80,3 +80,9 @@ class PristineTar(Command): self.run_error = ("Couldn't commit to '%s' with upstream '%s': {stderr_or_reason}" % (self.branch, upstream)) self.__call__(['commit', archive, upstream]) + + def verify(self, archive): + """Verify an archive's I{archive} checksum using to the pristine tar branch""" + + self.run_error = 'Pristine-tar couldn\'t verify "%s": {stderr_or_reason}' % os.path.basename(archive) + self.__call__(['verify', archive]) diff --git a/tests/doctests/test_PristineTar.py b/tests/doctests/test_PristineTar.py index a7927032..928ee286 100644 --- a/tests/doctests/test_PristineTar.py +++ b/tests/doctests/test_PristineTar.py @@ -137,6 +137,19 @@ def test_pristine_tar_checkout(): """ +def test_pristine_tar_verify(): + """ + Verify a tarball using pristine-tar + + Methods tested: + - L{gbp.deb.pristinetar.DebianPristineTar.verify} + + >>> import gbp.deb.git + >>> repo = gbp.deb.git.DebianGitRepository(dirs['repo']) + >>> repo.pristine_tar.verify('../upstream_1.0.orig.tar.gz') + """ + + def test_pristine_tar_checkout_nonexistent(): """ Checkout a tarball that does not exist using pristine-tar |