aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuido Günther <agx@sigxcpu.org>2017-01-10 15:23:37 +0100
committerGuido Günther <agx@sigxcpu.org>2017-01-10 15:26:37 +0100
commit3335bfe1e8fe57945c0ce6ee7f89f144bf54d0ac (patch)
tree68cac1b318ef79e39b54ce23415592878bc55840
parentab8ce5e03e5912876f299e208ddc02a17e05189d (diff)
import_dsc: test bare repository import
-rw-r--r--tests/component/deb/test_import_dsc.py32
1 files changed, 32 insertions, 0 deletions
diff --git a/tests/component/deb/test_import_dsc.py b/tests/component/deb/test_import_dsc.py
index 3d9e1bc..ed58679 100644
--- a/tests/component/deb/test_import_dsc.py
+++ b/tests/component/deb/test_import_dsc.py
@@ -207,3 +207,35 @@ class TestImportDsc(ComponentTestBase):
assert os.path.exists('targetdir')
repo = ComponentTestGitRepository('targetdir')
self._check_repo_state(repo, 'master', ['master', 'upstream'])
+
+ def test_bare(self):
+ """Test if importing into bare repository"""
+ def _dsc(version):
+ return os.path.join(DEB_TEST_DATA_DIR,
+ 'dsc-3.0',
+ 'hello-debhelper_%s.dsc' % version)
+
+ dsc = _dsc('2.6-2')
+ assert import_dsc(['arg0',
+ '--verbose',
+ '--pristine-tar',
+ '--debian-branch=master',
+ '--upstream-branch=upstream',
+ dsc]) == 0
+ repo = ComponentTestGitRepository('hello-debhelper')
+ os.chdir('hello-debhelper')
+ assert len(repo.get_commits()) == 2
+ reflog, ret = repo._git_getoutput('reflog')
+ ok_("gbp: Import Debian changes" in reflog[1])
+ ok_("gbp: Import Upstream version 2.6" in reflog[2])
+ self._check_repo_state(repo, 'master', ['master', 'pristine-tar', 'upstream'])
+
+ dsc = _dsc('2.8-1')
+ assert import_dsc(['arg0',
+ '--verbose',
+ '--pristine-tar',
+ '--debian-branch=master',
+ '--upstream-branch=upstream',
+ dsc]) == 0
+ commits, expected = len(repo.get_commits()), 4
+ ok_(commits == expected, "Found %d commit instead of %d" % (commits, expected))