summaryrefslogtreecommitdiff
path: root/tests/component/rpm
diff options
context:
space:
mode:
authorMarkus Lehtonen <markus.lehtonen@linux.intel.com>2013-01-09 14:06:39 +0200
committerMarkus Lehtonen <markus.lehtonen@linux.intel.com>2014-06-05 14:20:06 +0300
commit4e02c93cb50774ac0f6f553f7857efb20f456a5c (patch)
tree9750b0b5afa9706d45d11d3235f1533a1a6a59e9 /tests/component/rpm
parent9f0acd1e691518cb031707bc4affdd262a5e5335 (diff)
downloadgit-buildpackage-4e02c93cb50774ac0f6f553f7857efb20f456a5c.tar.gz
git-buildpackage-4e02c93cb50774ac0f6f553f7857efb20f456a5c.tar.bz2
git-buildpackage-4e02c93cb50774ac0f6f553f7857efb20f456a5c.zip
import-srpm: enhance spec guessing
Use package name (in case of src.rpm) or directory name (in case of dir) as the preferred name of the spec file. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Diffstat (limited to 'tests/component/rpm')
-rw-r--r--tests/component/rpm/test_import_srpm.py15
1 files changed, 13 insertions, 2 deletions
diff --git a/tests/component/rpm/test_import_srpm.py b/tests/component/rpm/test_import_srpm.py
index 0f1ffeba..e2458a74 100644
--- a/tests/component/rpm/test_import_srpm.py
+++ b/tests/component/rpm/test_import_srpm.py
@@ -53,6 +53,17 @@ class TestImportPacked(ComponentTestBase):
# of imported patches
assert len(repo.get_commits()) == 4
+ def test_basic_import2(self):
+ """Import package with multiple spec files and full url patch"""
+ srpm = os.path.join(DATA_DIR, 'gbp-test2-2.0-0.src.rpm')
+ assert import_srpm(['arg0', srpm]) == 0
+ # Check repository state
+ repo = GitRepository('gbp-test2')
+ self._check_repo_state(repo, 'master', ['master', 'upstream'])
+ # Four commits: upstream, packaging files, one patch and the removal
+ # of imported patches
+ assert len(repo.get_commits()) == 4
+
def test_basic_import_orphan(self):
"""
Test importing of non-native src.rpm to separate packaging and
@@ -221,9 +232,9 @@ class TestImportUnPacked(ComponentTestBase):
def test_missing_files(self):
"""Test importing of directory with missing packaging files"""
-
+ specfile = 'gbp-test2-2.0-0-unpack/gbp-test2.spec'
os.unlink('gbp-test2-2.0-0-unpack/my.patch')
- assert import_srpm(['arg0', 'gbp-test2-2.0-0-unpack']) == 1
+ assert import_srpm(['arg0', specfile]) == 1
self._check_log(-1, "gbp:error: File 'my.patch' listed in spec "
"not found")