~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_permissions.py

  • Committer: Andrew Bennetts
  • Date: 2010-11-22 03:35:24 UTC
  • mto: This revision was merged to the branch mainline in revision 5547.
  • Revision ID: andrew.bennetts@canonical.com-20101122033524-ouxj0onm3gtkimx3
Remove RepositoryFormatCHK1 and RepositoryFormatCHK2.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2005-2011 Canonical Ltd
 
1
# Copyright (C) 2005-2010 Canonical Ltd
2
2
# -*- coding: utf-8 -*-
3
3
#
4
4
# This program is free software; you can redistribute it and/or modify
32
32
 
33
33
import os
34
34
import sys
 
35
import stat
 
36
from cStringIO import StringIO
35
37
import urllib
36
38
 
37
39
from bzrlib import transport
63
65
    :param dir_mode: The mode for all directories
64
66
    :param include_base: If false, only check the subdirectories
65
67
    """
66
 
    t = test.get_transport()
 
68
    t = transport.get_transport(".")
67
69
    if include_base:
68
70
        test.assertTransportMode(t, base, dir_mode)
69
71
    for root, dirs, files in os.walk(base):
138
140
    def test_new_files_group_sticky_bit(self):
139
141
        if sys.platform == 'win32':
140
142
            raise TestSkipped('chmod has no effect on win32')
141
 
        elif sys.platform == 'darwin' or 'freebsd' in sys.platform:
142
 
            # FreeBSD-based platforms create temp dirs with the 'wheel' group,
143
 
            # which users are not likely to be in, and this prevents us from
144
 
            # setting the sgid bit
 
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
145
147
            os.chown(self.test_dir, os.getuid(), os.getgid())
146
148
 
147
149
        t = self.make_branch_and_tree('.')
178
180
 
179
181
        # bodge around for stubsftpserver not letting use connect
180
182
        # more than once
181
 
        _t = self.get_transport()
 
183
        _t = transport.get_transport(self.get_url())
182
184
 
183
185
        os.mkdir('local')
184
186
        t_local = self.make_branch_and_tree('local')
255
257
        original_umask = os.umask(umask)
256
258
 
257
259
        try:
258
 
            t = self.get_transport()
 
260
            t = transport.get_transport(self.get_url())
259
261
            # Direct access should be masked by umask
260
262
            t._sftp_open_exclusive('a', mode=0666).write('foo\n')
261
263
            self.assertTransportMode(t, 'a', 0666 &~umask)