aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests
diff options
context:
space:
mode:
authorGuido Günther <agx@sigxcpu.org>2019-10-07 11:23:13 +0200
committerGuido Günther <agx@sigxcpu.org>2019-10-07 13:49:11 +0200
commit11f9f31d52bf894e41728b25c0994f88ead3fedd (patch)
treee930c58089991a6640ec0a501d56900b6e2a7966 /tests
parentfb26fd9229f8a836e8ddef643e6e9c4c128dd2af (diff)
export-orig: Check 'origin/pristine-tar' as well for compression type
Closes: #941894
Diffstat (limited to 'tests')
-rw-r--r--tests/05_test_detection.py3
-rw-r--r--tests/component/deb/test_export_orig.py18
2 files changed, 21 insertions, 0 deletions
diff --git a/tests/05_test_detection.py b/tests/05_test_detection.py
index 5e903db3..d6322335 100644
--- a/tests/05_test_detection.py
+++ b/tests/05_test_detection.py
@@ -21,6 +21,9 @@ class MockGitRepository:
def has_pristine_tar_branch(self):
return self.with_branch
+ def has_branch(self, branch, remote=False):
+ return branch == 'pristine-tar' and self.with_branch
+
def pristine_tar_branch(self):
'pristine-tar'
diff --git a/tests/component/deb/test_export_orig.py b/tests/component/deb/test_export_orig.py
index b2a8e8bb..c01562de 100644
--- a/tests/component/deb/test_export_orig.py
+++ b/tests/component/deb/test_export_orig.py
@@ -21,9 +21,11 @@ import os
from tests.component import (ComponentTestBase,
ComponentTestGitRepository)
from tests.component.deb import DEB_TEST_DATA_DIR
+from tests.component.deb.fixtures import RepoFixtures
from nose.tools import ok_, assert_false, assert_true
+from gbp.scripts.clone import main as clone
from gbp.scripts.import_dsc import main as import_dsc
from gbp.scripts.export_orig import main as export_orig
@@ -136,3 +138,19 @@ class TestExportOrig(ComponentTestBase):
for t in tarballs:
self.assertFalse(os.path.exists(os.path.join('..', t)), "Tarball %s found" % t)
self.assertTrue(os.path.exists(os.path.join(DEB_TEST_DATA_DIR, 'foo-2.8', t)), "Tarball %s not found" % t)
+
+ @RepoFixtures.quilt30(opts=['--pristine-tar'])
+ def test_pristine_tar_commit_on_origin(self, repo):
+ """Test that we can create tarball from 'origin/pristine-tar'"""
+
+ assert_true(repo.has_branch('pristine-tar'),
+ "Pristine-tar branch must exist in origin")
+ dest = os.path.join(self._tmpdir, 'cloned_repo')
+ clone(['arg0', repo.path, dest])
+ cloned = ComponentTestGitRepository(dest)
+
+ os.chdir(cloned.path)
+ assert_false(cloned.has_branch('pristine-tar'),
+ "Pristine-tar branch must not exist in clone")
+ ret = export_orig(['arg0', '--pristine-tar'])
+ ok_(ret == 0, "Exporting tarballs must not fail")