~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_lockable_files.py

  • Committer: Andrew Bennetts
  • Date: 2010-10-08 08:15:14 UTC
  • mto: This revision was merged to the branch mainline in revision 5498.
  • Revision ID: andrew.bennetts@canonical.com-20101008081514-dviqzrdfwyzsqbz2
Split NEWS into per-release doc/en/release-notes/bzr-*.txt

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
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
14
14
# along with this program; if not, write to the Free Software
15
15
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
16
 
 
17
from StringIO import StringIO
 
18
 
17
19
import bzrlib
18
20
from bzrlib import (
19
21
    errors,
21
23
    osutils,
22
24
    transport,
23
25
    )
 
26
from bzrlib.errors import BzrBadParameterNotString, NoSuchFile, ReadOnlyError
24
27
from bzrlib.lockable_files import LockableFiles, TransportLock
 
28
from bzrlib.symbol_versioning import (
 
29
    deprecated_in,
 
30
    )
25
31
from bzrlib.tests import (
26
32
    TestCaseInTempDir,
27
33
    TestNotApplicable,
272
278
                                      _TestLockableFiles_mixin):
273
279
 
274
280
    def setUp(self):
275
 
        super(TestLockableFiles_TransportLock, self).setUp()
276
 
        t = transport.get_transport_from_path('.')
 
281
        TestCaseInTempDir.setUp(self)
 
282
        t = transport.get_transport('.')
277
283
        t.mkdir('.bzr')
278
284
        self.sub_transport = t.clone('.bzr')
279
285
        self.lockable = self.get_lockable()
293
299
 
294
300
 
295
301
class TestLockableFiles_LockDir(TestCaseInTempDir,
296
 
                                _TestLockableFiles_mixin):
 
302
                              _TestLockableFiles_mixin):
297
303
    """LockableFile tests run with LockDir underneath"""
298
304
 
299
305
    def setUp(self):
300
 
        super(TestLockableFiles_LockDir, self).setUp()
301
 
        self.transport = transport.get_transport_from_path('.')
 
306
        TestCaseInTempDir.setUp(self)
 
307
        self.transport = transport.get_transport('.')
302
308
        self.lockable = self.get_lockable()
303
309
        # the lock creation here sets mode - test_permissions on branch
304
310
        # tests that implicitly, but it might be a good idea to factor
329
335
 
330
336
 
331
337
class TestLockableFiles_RemoteLockDir(TestCaseWithSmartMedium,
332
 
                                      _TestLockableFiles_mixin):
 
338
                              _TestLockableFiles_mixin):
333
339
    """LockableFile tests run with RemoteLockDir on a branch."""
334
340
 
335
341
    def setUp(self):
336
 
        super(TestLockableFiles_RemoteLockDir, self).setUp()
 
342
        TestCaseWithSmartMedium.setUp(self)
337
343
        # can only get a RemoteLockDir with some RemoteObject...
338
344
        # use a branch as thats what we want. These mixin tests test the end
339
345
        # to end behaviour, so stubbing out the backend and simulating would
341
347
        # in test_remote and test_smart as usual.
342
348
        b = self.make_branch('foo')
343
349
        self.addCleanup(b.bzrdir.transport.disconnect)
344
 
        self.transport = transport.get_transport_from_path('.')
 
350
        self.transport = transport.get_transport('.')
345
351
        self.lockable = self.get_lockable()
346
352
 
347
353
    def get_lockable(self):