summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Lehtonen <markus.lehtonen@linux.intel.com>2014-06-26 10:05:01 +0300
committerMarkus Lehtonen <markus.lehtonen@linux.intel.com>2014-06-30 14:14:44 +0300
commitaca165670f400c5d6b8556ff0849498f15546a60 (patch)
treed903efe80861b358047a402db7480d2d28a72a8c
parentb04812b6f4e3f3859c4fd17b62ea9ed5d3bc035a (diff)
downloadgit-buildpackage-aca165670f400c5d6b8556ff0849498f15546a60.tar.gz
git-buildpackage-aca165670f400c5d6b8556ff0849498f15546a60.tar.bz2
git-buildpackage-aca165670f400c5d6b8556ff0849498f15546a60.zip
ComponentTestBase: add ls_tree() method
Change-Id: I53b06b41f613baad038117f55c27e7ebdaaadd7e Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
-rw-r--r--tests/component/__init__.py7
-rw-r--r--tests/component/rpm/test_import_orig_rpm.py7
2 files changed, 7 insertions, 7 deletions
diff --git a/tests/component/__init__.py b/tests/component/__init__.py
index 0c7e27f3..33caea70 100644
--- a/tests/component/__init__.py
+++ b/tests/component/__init__.py
@@ -134,6 +134,13 @@ class ComponentTestBase(object):
(list(extra), list(missing))
assert not extra and not missing, assert_msg
+ @staticmethod
+ def ls_tree(repo, treeish):
+ """List contents (blobs) in a git treeish"""
+ objs = repo.list_tree(treeish, True)
+ blobs = [obj[3] for obj in objs if obj[1] == 'blob']
+ return set(blobs)
+
@classmethod
def _check_repo_state(cls, repo, current_branch, branches, files=None):
"""Check that repository is clean and given branches exist"""
diff --git a/tests/component/rpm/test_import_orig_rpm.py b/tests/component/rpm/test_import_orig_rpm.py
index 935e995f..27cfab45 100644
--- a/tests/component/rpm/test_import_orig_rpm.py
+++ b/tests/component/rpm/test_import_orig_rpm.py
@@ -89,13 +89,6 @@ class ImportOrigTestBase(ComponentTestBase):
"""Test case setup"""
super(ImportOrigTestBase, self).setup()
- @staticmethod
- def ls_tree(repo, treeish):
- """List contents (blobs) in a git treeish"""
- objs = repo.list_tree(treeish, True)
- blobs = [obj[3] for obj in objs if obj[1] == 'blob']
- return set(blobs)
-
@classmethod
def check_tree(cls, repo, treeish, filelist):
"""Check the contents (list of files) in a git treeish"""