diff options
author | Guido Günther <agx@sigxcpu.org> | 2017-08-03 17:54:33 -0300 |
---|---|---|
committer | Guido Günther <agx@sigxcpu.org> | 2017-08-03 17:54:33 -0300 |
commit | 8edd16022d75967a8fe54ef99a0733400a287bc2 (patch) | |
tree | 257d2acbdc33e7526ac890953165b983cc8d33e7 /tests/04_test_submodules.py | |
parent | 348e9927dfbd7d4046d95e660e1041b64ef32ee8 (diff) |
Make orig_file a method of DebianSource
to have fewer objectless helpers and functions with fewer parameters.
Diffstat (limited to 'tests/04_test_submodules.py')
-rw-r--r-- | tests/04_test_submodules.py | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/tests/04_test_submodules.py b/tests/04_test_submodules.py index 9e93d53b..4c297e77 100644 --- a/tests/04_test_submodules.py +++ b/tests/04_test_submodules.py @@ -13,6 +13,8 @@ import gbp.log import gbp.git import gbp.command_wrappers +from gbp.deb.policy import DebianPkgPolicy as Policy + from gbp.scripts import buildpackage from gbp.scripts import export_orig from gbp.scripts.common.buildpackage import (git_archive_submodules, @@ -125,16 +127,22 @@ def test_dump_tree(): def test_create_tarballs(): """Create an upstream tarball""" - class source: + class MockedSource: def __init__(self, version): self.name = 'test' self.upstream_version = version + + def upstream_tarball_name(self, compression, component=None): + return Policy.build_tarball_name(self.name, + self.upstream_version, + compression=compression) + # Tarball with submodules - s = source('0.1') + s = MockedSource('0.1') ok_(export_orig.git_archive(REPO, s, str(TMPDIR), "HEAD", "bzip2", 9, True)) # Tarball without submodules - s = source('0.2') + s = MockedSource('0.2') ok_(export_orig.git_archive(REPO, s, str(TMPDIR), "HEAD", "bzip2", 9, False)) |