~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/__init__.py

  • Committer: Jelmer Vernooij
  • Date: 2011-05-04 22:23:20 UTC
  • mfrom: (5825 +trunk)
  • mto: This revision was merged to the branch mainline in revision 5830.
  • Revision ID: jelmer@samba.org-20110504222320-bczsppms2wadcrb4
Merge bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2125
2125
                      % (process_args, retcode, process.returncode))
2126
2126
        return [out, err]
2127
2127
 
2128
 
    def check_inventory_shape(self, inv, shape):
2129
 
        """Compare an inventory to a list of expected names.
 
2128
    def check_tree_shape(self, tree, shape):
 
2129
        """Compare a tree to a list of expected names.
2130
2130
 
2131
2131
        Fail if they are not precisely equal.
2132
2132
        """
2133
2133
        extras = []
2134
2134
        shape = list(shape)             # copy
2135
 
        for path, ie in inv.entries():
 
2135
        for path, ie in tree.iter_entries_by_dir():
2136
2136
            name = path.replace('\\', '/')
2137
2137
            if ie.kind == 'directory':
2138
2138
                name = name + '/'
2139
 
            if name in shape:
 
2139
            if name == "/":
 
2140
                pass # ignore root entry
 
2141
            elif name in shape:
2140
2142
                shape.remove(name)
2141
2143
            else:
2142
2144
                extras.append(name)