~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Vincent Ladeuil
  • Date: 2007-10-23 07:15:13 UTC
  • mfrom: (2926 +trunk)
  • mto: (2961.1.1 trunk)
  • mto: This revision was merged to the branch mainline in revision 2962.
  • Revision ID: v.ladeuil+lp@free.fr-20071023071513-elryt6g2at34d2ur
merge bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
 
19
19
import os
20
20
 
 
21
from bzrlib import (
 
22
    osutils,
 
23
    )
21
24
from bzrlib.inventory import InventoryFile
22
25
from bzrlib.transform import TreeTransform
23
26
from bzrlib.tests.workingtree_implementations import TestCaseWithWorkingTree
175
178
        self.wt.revert(old_tree=rev_tree, backups=False)
176
179
        self.check_exist(self.wt)
177
180
 
 
181
    def test_commit_with_exec_from_basis(self):
 
182
        self.wt._is_executable_from_path_and_stat = \
 
183
            self.wt._is_executable_from_path_and_stat_from_basis
 
184
        rev_id1 = self.wt.commit('one')
 
185
        rev_tree1 = self.wt.branch.repository.revision_tree(rev_id1)
 
186
        a_executable = rev_tree1.inventory[self.a_id].executable
 
187
        b_executable = rev_tree1.inventory[self.b_id].executable
 
188
        self.assertIsNot(None, a_executable)
 
189
        self.assertTrue(a_executable)
 
190
        self.assertIsNot(None, b_executable)
 
191
        self.assertFalse(b_executable)
 
192
 
 
193
    def test_use_exec_from_basis(self):
 
194
        if osutils.supports_executable():
 
195
            self.assertEqual(self.wt._is_executable_from_path_and_stat_from_stat,
 
196
                             self.wt._is_executable_from_path_and_stat)
 
197
        else:
 
198
            self.assertEqual(self.wt._is_executable_from_path_and_stat_from_basis,
 
199
                             self.wt._is_executable_from_path_and_stat)