[git-buildpackage] [PATCH 06/11] ComponentTestBase: add ls_tree() method

Markus Lehtonen markus.lehtonen at linux.intel.com
Tue Oct 20 13:05:31 CEST 2015


Hi,

On Thu, 2015-10-08 at 13:18 +0300, Markus Lehtonen wrote:
> Hi,
> 
> On 02/04/15 08:10, "Guido Günther" <agx at sigxcpu.org> wrote:
> 
> >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,
> 
> Hmm, what was I thinking when adding this here... This is supposed to be a
> helper method quite similar to ls_dir() et al. Thus, it should've gone to
> testutils. But, now that you pointed it out ComponentTestBaseGitRepository
> seems like a better place.

This is now fixed in my latest patchset available at:

  git://github.com/marquiz/git-buildpackage-rpm.git
feature/upstream/buildpackage-rpm

The commit subject was changed to "ComponentTestGitRepository: add
ls_tree() method".


Thanks,
   Markus



More information about the git-buildpackage mailing list