aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests
diff options
context:
space:
mode:
authorMarkus Lehtonen <markus.lehtonen@linux.intel.com>2018-01-22 14:28:08 +0200
committerMarkus Lehtonen <markus.lehtonen@linux.intel.com>2018-01-22 14:56:17 +0200
commit8515181255c532fe25cd1b8b0c59814ea0eb2003 (patch)
treef9ab9c4c8375ace172e21231d0aa6e84b3e5c1db /tests
parent972db70347d5fa37f9af74babf8021a41cb7d219 (diff)
import-srpm: support --upstream-vcs-tag cmdline option
Similar to what the option does in git-import-orig. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/component/rpm/test_import_srpm.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/component/rpm/test_import_srpm.py b/tests/component/rpm/test_import_srpm.py
index 15db0cf0..17344b21 100644
--- a/tests/component/rpm/test_import_srpm.py
+++ b/tests/component/rpm/test_import_srpm.py
@@ -285,6 +285,22 @@ class TestImportPacked(ComponentTestBase):
eq_(info['author'].name, info['committer'].name)
eq_(info['author'].email, info['committer'].email)
+ # Create a new commit by committing an empty tree
+ commit = repo.commit_tree('4b825dc642cb6eb9a060e54bf8d69288fbee4904',
+ msg="Empty commit", parents=[])
+ repo.create_tag('foo/1.0', msg="New tag", commit=commit)
+ # Just blindly import another package on top of this to test more options
+ os.chdir('gbp-test2')
+ srpm = os.path.join(DATA_DIR, 'gbp-test-1.0-1.src.rpm')
+ eq_(mock_import(['--upstream-vcs-tag=foo/%(version)s',
+ '--upstream-branch=orig',
+ '--packaging-branch=pack',
+ srpm]), 0)
+ parents = repo.get_commits(until='orig', num=1, options='--format=%P')[0].split()
+ eq_(len(parents), 2)
+ ok_(commit in parents)
+ ok_(repo.rev_parse('orig/2.0^{}') in parents)
+
class TestImportUnPacked(ComponentTestBase):
"""Test importing of unpacked source rpms"""