~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_dirstate.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2010-01-26 10:49:57 UTC
  • mfrom: (4987.1.1 integration)
  • Revision ID: pqm@pqm.ubuntu.com-20100126104957-dmtqnc0pckuruyla
(vila,
        jam) Implement TestCase.overrideAttr to simplify tests setUp/cleanup

Show diffs side-by-side

added added

removed removed

Lines of Context:
64
64
    def setUp(self):
65
65
        tests.TestCaseWithTransport.setUp(self)
66
66
 
67
 
        # Save platform specific info and reset it
68
 
        cur_dir_reader = osutils._selected_dir_reader
69
 
 
70
 
        def restore():
71
 
            osutils._selected_dir_reader = cur_dir_reader
72
 
        self.addCleanup(restore)
73
 
 
74
 
        osutils._selected_dir_reader = self._dir_reader_class()
 
67
        self.overrideAttr(osutils,
 
68
                          '_selected_dir_reader', self._dir_reader_class())
75
69
 
76
70
    def create_empty_dirstate(self):
77
71
        """Return a locked but empty dirstate"""