[git-buildpackage] [PATCH 06/11] ComponentTestBase: add ls_tree() method
Guido Günther
agx at sigxcpu.org
Thu Apr 2 08:10:40 CEST 2015
On Thu, Jun 26, 2014 at 10:05:01AM +0300, Markus Lehtonen wrote:
> Signed-off-by: Markus Lehtonen <markus.lehtonen at linux.intel.com>
> ---
> tests/component/__init__.py | 7 +++++++
> 1 file changed, 7 insertions(+)
>
> diff --git a/tests/component/__init__.py b/tests/component/__init__.py
> index b0376c1..4b070ab 100644
> --- a/tests/component/__init__.py
> +++ b/tests/component/__init__.py
> @@ -134,6 +134,13 @@ class ComponentTestBase(GbpLogTester):
> (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)
> +
I was under the impression that ComponentTestBase hass additional
asserts for tests. This one doesn't assert? Does this better fit onto
the ComponentTestBaseGitRepository itself or even GitRepository itself?
Cheers,
-- Guido
> @classmethod
> def _check_repo_state(cls, repo, current_branch, branches, files=None,
> dirs=None):
> 2.1.4
More information about the git-buildpackage
mailing list