/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_selftest.py

  • Committer: Andrew Bennetts
  • Date: 2009-05-01 07:59:02 UTC
  • mfrom: (4319 +trunk)
  • mto: This revision was merged to the branch mainline in revision 4320.
  • Revision ID: andrew.bennetts@canonical.com-20090501075902-evil2r4edle6qx4d
Merge from bzr.dev, resolving a conflict.

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
from bzrlib import (
29
29
    branchbuilder,
30
30
    bzrdir,
 
31
    debug,
31
32
    errors,
 
33
    lockdir,
32
34
    memorytree,
33
35
    osutils,
34
36
    remote,
619
621
        # But we have a safety net in place.
620
622
        self.assertRaises(AssertionError, self._check_safety_net)
621
623
 
 
624
    def test_dangling_locks_cause_failures(self):
 
625
        # This is currently only enabled during debug runs, so turn debugging
 
626
        # on.
 
627
        debug.debug_flags.add('lock')
 
628
        class TestDanglingLock(TestCaseWithMemoryTransport):
 
629
            def test_function(self):
 
630
                t = self.get_transport('.')
 
631
                l = lockdir.LockDir(t, 'lock')
 
632
                l.create()
 
633
                l.attempt_lock()
 
634
        test = TestDanglingLock('test_function')
 
635
        result = test.run()
 
636
        self.assertEqual(1, len(result.errors))
 
637
 
622
638
 
623
639
class TestTestCaseWithTransport(TestCaseWithTransport):
624
640
    """Tests for the convenience functions TestCaseWithTransport introduces."""