/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: John Arbash Meinel
  • Date: 2009-07-31 16:22:54 UTC
  • mto: This revision was merged to the branch mainline in revision 4611.
  • Revision ID: john@arbash-meinel.com-20090731162254-cnp93fq23p18uavb
Add a test that thisFailsStrictLockCheck() does the right thing.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1459
1459
        self.assertFalse(self.test_lock_check_thorough)
1460
1460
        self.assertEqual(set(), self.flags)
1461
1461
 
 
1462
    def test_this_fails_strict_lock_check(self):
 
1463
        class TestThatRecordsFlags(tests.TestCase):
 
1464
            def test_foo(nested_self):
 
1465
                self.flags1 = set(bzrlib.debug.debug_flags)
 
1466
                self.thisFailsStrictLockCheck()
 
1467
                self.flags2 = set(bzrlib.debug.debug_flags)
 
1468
        # Make sure lock checking is active
 
1469
        self.change_selftest_debug_flags(set())
 
1470
        test = TestThatRecordsFlags('test_foo')
 
1471
        test.run(self.make_test_result())
 
1472
        self.assertEqual(set(['strict_locks']), self.flags1)
 
1473
        self.assertEqual(set(), self.flags2)
 
1474
 
1462
1475
    def test_debug_flags_restored(self):
1463
1476
        """The bzrlib debug flags should be restored to their original state
1464
1477
        after the test was run, even if allow_debug is set.