~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_permissions.py

  • Committer: Gordon Tyler
  • Date: 2011-01-21 23:51:15 UTC
  • mto: This revision was merged to the branch mainline in revision 5632.
  • Revision ID: gordon@doxxx.net-20110121235115-9sdqamejot1h0481
Replace usage of format function from python 2.6 with our own very simple formatting function.

Show diffs side-by-side

added added

removed removed

Lines of Context:
63
63
    :param dir_mode: The mode for all directories
64
64
    :param include_base: If false, only check the subdirectories
65
65
    """
66
 
    t = test.get_transport()
 
66
    t = transport.get_transport(".")
67
67
    if include_base:
68
68
        test.assertTransportMode(t, base, dir_mode)
69
69
    for root, dirs, files in os.walk(base):
138
138
    def test_new_files_group_sticky_bit(self):
139
139
        if sys.platform == 'win32':
140
140
            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
 
141
        elif sys.platform == 'darwin' or sys.platform.startswith('freebsd'):
 
142
            # OS X (and FreeBSD) create temp dirs with the 'wheel' group, which
 
143
            # users are not likely to be in, and this prevents us from setting
 
144
            # the sgid bit
145
145
            os.chown(self.test_dir, os.getuid(), os.getgid())
146
146
 
147
147
        t = self.make_branch_and_tree('.')
178
178
 
179
179
        # bodge around for stubsftpserver not letting use connect
180
180
        # more than once
181
 
        _t = self.get_transport()
 
181
        _t = transport.get_transport(self.get_url())
182
182
 
183
183
        os.mkdir('local')
184
184
        t_local = self.make_branch_and_tree('local')
255
255
        original_umask = os.umask(umask)
256
256
 
257
257
        try:
258
 
            t = self.get_transport()
 
258
            t = transport.get_transport(self.get_url())
259
259
            # Direct access should be masked by umask
260
260
            t._sftp_open_exclusive('a', mode=0666).write('foo\n')
261
261
            self.assertTransportMode(t, 'a', 0666 &~umask)