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
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)
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)
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)
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)
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)