diff options
author | Markus Lehtonen <markus.lehtonen@linux.intel.com> | 2015-10-05 13:59:26 +0300 |
---|---|---|
committer | Guido Günther <agx@sigxcpu.org> | 2015-12-02 18:50:32 +0100 |
commit | f7cd0f94a8734bc2716f97e6590fd63b2fa60c4d (patch) | |
tree | 0fd2e177279c61d53a1ef993e89ca0ce94086149 /tests/04_test_submodules.py | |
parent | 0f2f346678aaea585ca4f58367f581239712db16 (diff) |
common/buildpackage: support for different archive formats
Adds support for defining the archive format of the output of
git_archive_single(), e.g. 'zip'. Defaults to 'tar', as before.
Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com>
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Diffstat (limited to 'tests/04_test_submodules.py')
-rw-r--r-- | tests/04_test_submodules.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/04_test_submodules.py b/tests/04_test_submodules.py index deb389d1..34dc9913 100644 --- a/tests/04_test_submodules.py +++ b/tests/04_test_submodules.py @@ -14,6 +14,9 @@ import gbp.git import gbp.command_wrappers from gbp.scripts import buildpackage +from gbp.scripts.common.buildpackage import (git_archive_submodules, + git_archive_single) +from tests.testutils import ls_zip REPO = None REPODIR = None @@ -127,6 +130,19 @@ def test_create_tarballs(): ok_(buildpackage.git_archive(REPO, changelog, str(TMPDIR), "HEAD", "bzip2", "9", False)) +def test_create_zip_archives(): + """Create an upstream zip archive""" + git_archive_submodules(REPO, 'HEAD', 'with-submodules.zip', 'test', + '', '', '', 'zip') + # Check that submodules were included + contents = ls_zip('with-submodules.zip') + ok_('test/test_submodule/testfile' in contents) + + git_archive_single('HEAD', 'without-submodules.zip', 'test', + '', '', '', 'zip') + contents = ls_zip('without-submodules.zip') + ok_('test/test_submodule/testfile' not in contents) + def test_check_tarfiles(): """Check the contents of the created tarfile""" # Check tarball with submodules |