~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/per_bzrdir/test_bzrdir.py

  • Committer: Vincent Ladeuil
  • Date: 2010-01-26 10:17:22 UTC
  • mfrom: (4985.1.5 add-attr-cleanup)
  • mto: This revision was merged to the branch mainline in revision 4988.
  • Revision ID: v.ladeuil+lp@free.fr-20100126101722-y213sv39buw3dgi2
Implement TestCase.overrideAttr to simplify tests setUp/cleanup

Show diffs side-by-side

added added

removed removed

Lines of Context:
1797
1797
 
1798
1798
class TestBreakLock(TestCaseWithBzrDir):
1799
1799
 
1800
 
    def setUp(self):
1801
 
        super(TestBreakLock, self).setUp()
1802
 
        # we want a UI factory that accepts canned input for the tests:
1803
 
        # while SilentUIFactory still accepts stdin, we need to customise
1804
 
        # ours
1805
 
        self.old_factory = bzrlib.ui.ui_factory
1806
 
        self.addCleanup(self.restoreFactory)
1807
 
 
1808
 
    def restoreFactory(self):
1809
 
        bzrlib.ui.ui_factory = self.old_factory
1810
 
 
1811
1800
    def test_break_lock_empty(self):
1812
1801
        # break lock on an empty bzrdir should work silently.
1813
1802
        dir = self.make_bzrdir('.')