~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_permissions.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2008-08-14 17:25:43 UTC
  • mfrom: (3620.2.2 rules.disable)
  • Revision ID: pqm@pqm.ubuntu.com-20080814172543-nl22gdcodusa8rt0
(robertc) Disable .bzrrules from being read from the WT

Show diffs side-by-side

added added

removed removed

Lines of Context:
13
13
#
14
14
# You should have received a copy of the GNU General Public License
15
15
# along with this program; if not, write to the Free Software
16
 
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
 
16
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
17
17
 
18
18
 
19
19
"""Tests for bzr setting permissions.
26
26
"""
27
27
 
28
28
# TODO: jam 20051215 There are no tests for ftp yet, because we have no ftp server
29
 
# TODO: jam 20051215 Currently the default behavior for 'bzr branch' is just
 
29
# TODO: jam 20051215 Currently the default behavior for 'bzr branch' is just 
30
30
#                    defined by the local umask. This isn't terrible, is it
31
31
#                    the truly desired behavior?
32
 
 
 
32
 
33
33
import os
34
34
import sys
35
35
import stat
38
38
 
39
39
from bzrlib.branch import Branch
40
40
from bzrlib.bzrdir import BzrDir
 
41
from bzrlib.lockable_files import LockableFiles, TransportLock
41
42
from bzrlib.tests import TestCaseWithTransport, TestSkipped
42
43
from bzrlib.tests.test_sftp_transport import TestCaseWithSFTPServer
43
44
from bzrlib.transport import get_transport
96
97
 
97
98
        # although we are modifying the filesystem
98
99
        # underneath the objects, they are not locked, and thus it must
99
 
        # be safe for most operations. But here we want to observe a
 
100
        # be safe for most operations. But here we want to observe a 
100
101
        # mode change in the control bits, which current do not refresh
101
102
        # when a new lock is taken out.
102
103
        t = WorkingTree.open('.')
137
138
        t.commit('new c')
138
139
        check_mode_r(self, '.bzr', 0664, 0775)
139
140
 
140
 
    def test_new_files_group_sticky_bit(self):
141
 
        if sys.platform == 'win32':
142
 
            raise TestSkipped('chmod has no effect on win32')
143
 
        elif sys.platform == 'darwin' or sys.platform.startswith('freebsd'):
144
 
            # OS X (and FreeBSD) create temp dirs with the 'wheel' group, which
145
 
            # users are not likely to be in, and this prevents us from setting
146
 
            # the sgid bit
147
 
            os.chown(self.test_dir, os.getuid(), os.getgid())
148
 
 
149
 
        t = self.make_branch_and_tree('.')
150
 
        b = t.branch
151
 
 
152
141
        # Test the group sticky bit
153
142
        # Recursively update the modes of all files
154
143
        chmod_r('.bzr', 0664, 02775)