~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: 2010-02-11 02:16:42 UTC
  • mfrom: (5017.1.2 initialize)
  • Revision ID: pqm@pqm.ubuntu.com-20100211021642-eitum30b2e09oalf
(mbp) Add bzrlib.initialize

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2005-2010 Canonical Ltd
 
1
# Copyright (C) 2005 Canonical Ltd
2
2
# -*- coding: utf-8 -*-
3
3
#
4
4
# This program is free software; you can redistribute it and/or modify
36
36
from cStringIO import StringIO
37
37
import urllib
38
38
 
39
 
from bzrlib import transport
40
39
from bzrlib.branch import Branch
41
40
from bzrlib.bzrdir import BzrDir
42
41
from bzrlib.tests import TestCaseWithTransport, TestSkipped
43
42
from bzrlib.tests.test_sftp_transport import TestCaseWithSFTPServer
 
43
from bzrlib.transport import get_transport
44
44
from bzrlib.workingtree import WorkingTree
45
45
 
46
46
 
65
65
    :param dir_mode: The mode for all directories
66
66
    :param include_base: If false, only check the subdirectories
67
67
    """
68
 
    t = transport.get_transport(".")
 
68
    t = get_transport(".")
69
69
    if include_base:
70
70
        test.assertTransportMode(t, base, dir_mode)
71
71
    for root, dirs, files in os.walk(base):
180
180
 
181
181
        # bodge around for stubsftpserver not letting use connect
182
182
        # more than once
183
 
        _t = transport.get_transport(self.get_url())
 
183
        _t = get_transport(self.get_url())
184
184
 
185
185
        os.mkdir('local')
186
186
        t_local = self.make_branch_and_tree('local')
257
257
        original_umask = os.umask(umask)
258
258
 
259
259
        try:
260
 
            t = transport.get_transport(self.get_url())
 
260
            t = get_transport(self.get_url())
261
261
            # Direct access should be masked by umask
262
262
            t._sftp_open_exclusive('a', mode=0666).write('foo\n')
263
263
            self.assertTransportMode(t, 'a', 0666 &~umask)