aboutsummaryrefslogtreecommitdiff
path: root/tests/component/deb/test_buildpackage.py
diff options
context:
space:
mode:
authorGuido Günther <agx@sigxcpu.org>2017-01-17 20:10:00 +0100
committerGuido Günther <agx@sigxcpu.org>2017-01-17 20:11:01 +0100
commit1140886c80d5ef029bfd7b37b9ff8a24f07e6a69 (patch)
tree50907fe22435da93a1c1c55a96637f58cafa9020 /tests/component/deb/test_buildpackage.py
parent4eb8c383ad862cbf1fc6c3f7b86400869079035b (diff)
buildpackage: Don't set a compression level if unset and make this the default
This allows compressors to use the their default compression level. Only applies when not using pristine-tar. Thanks: Antoine Beaupré for investigating Closes: #820846
Diffstat (limited to 'tests/component/deb/test_buildpackage.py')
-rw-r--r--tests/component/deb/test_buildpackage.py24
1 files changed, 21 insertions, 3 deletions
diff --git a/tests/component/deb/test_buildpackage.py b/tests/component/deb/test_buildpackage.py
index 2e4cef6..49db96d 100644
--- a/tests/component/deb/test_buildpackage.py
+++ b/tests/component/deb/test_buildpackage.py
@@ -1,6 +1,6 @@
# vim: set fileencoding=utf-8 :
#
-# (C) 2015,2016 Guido Günther <agx@sigxcpu.org>
+# (C) 2015-2017 Guido Günther <agx@sigxcpu.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -17,6 +17,7 @@
# <http://www.gnu.org/licenses/>
import os
+import subprocess
from tests.component import (ComponentTestBase,
ComponentTestGitRepository)
@@ -147,8 +148,7 @@ class TestBuildpackage(ComponentTestBase):
self._test_buildpackage('hello-debhelper',
'dsc-3.0',
'2.8-1',
- ['--git-export-dir=../foo/bar'],
- )
+ ['--git-export-dir=../foo/bar'])
ok_(os.path.exists('../foo/bar'))
def test_argument_quoting(self):
@@ -171,3 +171,21 @@ class TestBuildpackage(ComponentTestBase):
'--git-cleaner=/bin/true',
'../arg with spaces'])
ok_(ret == 0, "Building the package failed")
+
+ def test_tarball_default_compression(self):
+ """Test that we use defaults for compression if not given (#820846)"""
+ self._test_buildpackage('hello-debhelper',
+ 'dsc-3.0',
+ '2.8-1',
+ ['--git-no-pristine-tar'])
+ out = subprocess.check_output(["file", "../hello-debhelper_2.8.orig.tar.gz"])
+ ok_("max compression" not in out)
+
+ def test_tarball_max_compression(self):
+ """Test that passing max compression works (#820846)"""
+ self._test_buildpackage('hello-debhelper',
+ 'dsc-3.0',
+ '2.8-1',
+ ['--git-no-pristine-tar', '--git-compression-level=9'])
+ out = subprocess.check_output(["file", "../hello-debhelper_2.8.orig.tar.gz"])
+ ok_("max compression" in out)