summaryrefslogtreecommitdiff
path: root/tests/component
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-11-14 14:21:38 +0200
commit826ab04197db4eab6eba4115d40a62bf1c75f205 (patch)
tree815d34336384368447929f9a2cb35eaac03b1e65 /tests/component
parentc7bfb6b8235d5599df6ae4dfb9a11384fe846447 (diff)
downloadgit-buildpackage-826ab04197db4eab6eba4115d40a62bf1c75f205.tar.gz
git-buildpackage-826ab04197db4eab6eba4115d40a62bf1c75f205.tar.bz2
git-buildpackage-826ab04197db4eab6eba4115d40a62bf1c75f205.zip
ComponentTestBase: add ls_tree() method
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Diffstat (limited to 'tests/component')
-rw-r--r--tests/component/__init__.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/component/__init__.py b/tests/component/__init__.py
index 6eb74fc4..b509c3b5 100644
--- a/tests/component/__init__.py
+++ b/tests/component/__init__.py
@@ -137,6 +137,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"""