ComponentTestBase: add ls_tree() method
authorMarkus Lehtonen <markus.lehtonen@linux.intel.com>
Thu, 26 Jun 2014 07:05:01 +0000 (10:05 +0300)
committerMarkus Lehtonen <markus.lehtonen@linux.intel.com>
Mon, 30 Jun 2014 11:14:44 +0000 (14:14 +0300)
Change-Id: I53b06b41f613baad038117f55c27e7ebdaaadd7e
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
tests/component/__init__.py
tests/component/rpm/test_import_orig_rpm.py

index 0c7e27f..33caea7 100644 (file)
@@ -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"""
index 935e995..27cfab4 100644 (file)
@@ -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"""