~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: 2006-03-06 07:44:17 UTC
  • mfrom: (1553.5.64 bzr.mbp.locks)
  • Revision ID: pqm@pqm.ubuntu.com-20060306074417-344f1d83d99b9730
Integrate LockDirs into new format, etc

Show diffs side-by-side

added added

removed removed

Lines of Context:
37
37
 
38
38
from bzrlib.branch import Branch
39
39
from bzrlib.bzrdir import BzrDir
40
 
from bzrlib.lockable_files import LockableFiles
 
40
from bzrlib.lockable_files import LockableFiles, TransportLock
41
41
from bzrlib.tests import TestCaseWithTransport, TestSkipped
42
42
from bzrlib.tests.test_sftp_transport import TestCaseWithSFTPServer
43
43
from bzrlib.transport import get_transport
157
157
        try:
158
158
            transport = get_transport(self.get_url())
159
159
            transport.put('my-lock', StringIO(''))
160
 
            lockable = LockableFiles(transport, 'my-lock')
 
160
            lockable = LockableFiles(transport, 'my-lock', TransportLock)
161
161
            self.assertNotEqual(None, lockable._dir_mode)
162
162
            self.assertNotEqual(None, lockable._file_mode)
163
163
 
164
164
            LockableFiles._set_dir_mode = False
165
165
            transport = get_transport('.')
166
 
            lockable = LockableFiles(transport, 'my-lock')
 
166
            lockable = LockableFiles(transport, 'my-lock', TransportLock)
167
167
            self.assertEqual(None, lockable._dir_mode)
168
168
            self.assertNotEqual(None, lockable._file_mode)
169
169
 
170
170
            LockableFiles._set_file_mode = False
171
171
            transport = get_transport('.')
172
 
            lockable = LockableFiles(transport, 'my-lock')
 
172
            lockable = LockableFiles(transport, 'my-lock', TransportLock)
173
173
            self.assertEqual(None, lockable._dir_mode)
174
174
            self.assertEqual(None, lockable._file_mode)
175
175
 
176
176
            LockableFiles._set_dir_mode = True
177
177
            transport = get_transport('.')
178
 
            lockable = LockableFiles(transport, 'my-lock')
 
178
            lockable = LockableFiles(transport, 'my-lock', TransportLock)
179
179
            self.assertNotEqual(None, lockable._dir_mode)
180
180
            self.assertEqual(None, lockable._file_mode)
181
181
 
182
182
            LockableFiles._set_file_mode = True
183
183
            transport = get_transport('.')
184
 
            lockable = LockableFiles(transport, 'my-lock')
 
184
            lockable = LockableFiles(transport, 'my-lock', TransportLock)
185
185
            self.assertNotEqual(None, lockable._dir_mode)
186
186
            self.assertNotEqual(None, lockable._file_mode)
187
187
        finally: