~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_lockable_files.py

  • Committer: John Arbash Meinel
  • Date: 2008-10-30 00:55:00 UTC
  • mto: (3815.2.5 prepare-1.9)
  • mto: This revision was merged to the branch mainline in revision 3811.
  • Revision ID: john@arbash-meinel.com-20081030005500-r5cej1cxflqhs3io
Switch so that we are using a simple timestamp as the first action.

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
from bzrlib.symbol_versioning import (
28
28
    deprecated_in,
29
29
    )
30
 
from bzrlib.tests import TestCaseInTempDir
 
30
from bzrlib.tests import (
 
31
    TestCaseInTempDir,
 
32
    TestNotApplicable,
 
33
    )
31
34
from bzrlib.tests.test_smart import TestCaseWithSmartMedium
32
35
from bzrlib.tests.test_transactions import DummyWeave
33
36
from bzrlib.transactions import (PassThroughTransaction,
154
157
        except NotImplementedError:
155
158
            # this lock cannot be broken
156
159
            self.lockable.unlock()
157
 
            return
 
160
            raise TestNotApplicable("%r is not breakable" % (self.lockable,))
158
161
        l2 = self.get_lockable()
159
162
        orig_factory = bzrlib.ui.ui_factory
160
163
        # silent ui - no need for stdout
177
180
            if token is not None:
178
181
                # This test does not apply, because this lockable supports
179
182
                # tokens.
180
 
                return
 
183
                raise TestNotApplicable("%r uses tokens" % (self.lockable,))
181
184
            self.assertRaises(errors.TokenLockingNotSupported,
182
185
                              self.lockable.lock_write, token='token')
183
186
        finally:
371
374
        super(TestLockableFiles_TransportLock, self).tearDown()
372
375
        # free the subtransport so that we do not get a 5 second
373
376
        # timeout due to the SFTP connection cache.
374
 
        del self.sub_transport
 
377
        try:
 
378
            del self.sub_transport
 
379
        except AttributeError:
 
380
            pass
375
381
 
376
382
    def get_lockable(self):
377
383
        return LockableFiles(self.sub_transport, 'my-lock', TransportLock)