~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_lockable_files.py

  • Committer: Martin Pool
  • Date: 2009-09-14 02:30:23 UTC
  • mto: This revision was merged to the branch mainline in revision 4693.
  • Revision ID: mbp@sourcefrog.net-20090914023023-ros0f3ndo04j3bww
Clearer docs about bzr help.  (Thanks to Naoki)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2005-2010 Canonical Ltd
 
1
# Copyright (C) 2005, 2006, 2008, 2009 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
21
21
    errors,
22
22
    lockdir,
23
23
    osutils,
24
 
    transport,
25
24
    )
26
25
from bzrlib.errors import BzrBadParameterNotString, NoSuchFile, ReadOnlyError
27
26
from bzrlib.lockable_files import LockableFiles, TransportLock
38
37
                                 ReadOnlyTransaction,
39
38
                                 WriteTransaction,
40
39
                                 )
 
40
from bzrlib.transport import get_transport
41
41
 
42
42
 
43
43
# these tests are applied in each parameterized suite for LockableFiles
279
279
 
280
280
    def setUp(self):
281
281
        TestCaseInTempDir.setUp(self)
282
 
        t = transport.get_transport('.')
283
 
        t.mkdir('.bzr')
284
 
        self.sub_transport = t.clone('.bzr')
 
282
        transport = get_transport('.')
 
283
        transport.mkdir('.bzr')
 
284
        self.sub_transport = transport.clone('.bzr')
285
285
        self.lockable = self.get_lockable()
286
286
        self.lockable.create_lock()
287
287
 
288
 
    def stop_server(self):
289
 
        super(TestLockableFiles_TransportLock, self).stop_server()
 
288
    def tearDown(self):
 
289
        super(TestLockableFiles_TransportLock, self).tearDown()
290
290
        # free the subtransport so that we do not get a 5 second
291
291
        # timeout due to the SFTP connection cache.
292
292
        try:
304
304
 
305
305
    def setUp(self):
306
306
        TestCaseInTempDir.setUp(self)
307
 
        self.transport = transport.get_transport('.')
 
307
        self.transport = get_transport('.')
308
308
        self.lockable = self.get_lockable()
309
309
        # the lock creation here sets mode - test_permissions on branch
310
310
        # tests that implicitly, but it might be a good idea to factor
347
347
        # in test_remote and test_smart as usual.
348
348
        b = self.make_branch('foo')
349
349
        self.addCleanup(b.bzrdir.transport.disconnect)
350
 
        self.transport = transport.get_transport('.')
 
350
        self.transport = get_transport('.')
351
351
        self.lockable = self.get_lockable()
352
352
 
353
353
    def get_lockable(self):