~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/workingtree_implementations/test_executable.py

  • Committer: Robert Collins
  • Date: 2006-07-24 04:40:06 UTC
  • mto: (1852.7.2 split-tree-source)
  • mto: This revision was merged to the branch mainline in revision 1890.
  • Revision ID: robertc@robertcollins.net-20060724044006-faa99aee0dff9ae9
Finish updating iter_entries change to make all tests pass.

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
 
19
19
import os
20
20
 
 
21
from bzrlib.inventory import InventoryFile
21
22
from bzrlib.transform import TreeTransform
22
23
from bzrlib.tests.workingtree_implementations import TestCaseWithWorkingTree
23
24
 
40
41
 
41
42
    def check_exist(self, tree):
42
43
        """Just check that both files have the right executable bits set"""
43
 
        measured = [(cn,ie.executable) 
44
 
                    for cn,ie in tree.inventory.iter_entries()]
 
44
        measured = []
 
45
        for cn, ie in tree.inventory.iter_entries():
 
46
            if isinstance(ie, InventoryFile):
 
47
                measured.append((cn, ie.executable))
45
48
        self.assertEqual([('a', True), ('b', False)], measured)
46
49
        self.failUnless(tree.is_executable(self.a_id),
47
50
                        "'a' lost the execute bit")
55
58
                the inventory is empty, just that the tree doesn't have them
56
59
        """
57
60
        if not ignore_inv:
58
 
            self.assertEqual([], list(tree.inventory.iter_entries()))
 
61
            self.assertEqual(
 
62
                [('', tree.inventory.root)],
 
63
                list(tree.inventory.iter_entries()))
59
64
        self.failIf(tree.has_id(self.a_id))
60
65
        self.failIf(tree.has_filename('a'))
61
66
        self.failIf(tree.has_id(self.b_id))