~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/per_interbranch/test_push.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:
280
280
    def disableOptimisticGetParentMap(self):
281
281
        # Tweak some class variables to stop remote get_parent_map calls asking
282
282
        # for or receiving more data than the caller asked for.
283
 
        old_flag = SmartServerRepositoryGetParentMap.no_extra_results
284
 
        inter_class = repository.InterRepository
285
 
        old_batch_size = inter_class._walk_to_common_revisions_batch_size
286
 
        inter_class._walk_to_common_revisions_batch_size = 1
287
 
        SmartServerRepositoryGetParentMap.no_extra_results = True
288
 
        def reset_values():
289
 
            SmartServerRepositoryGetParentMap.no_extra_results = old_flag
290
 
            inter_class._walk_to_common_revisions_batch_size = old_batch_size
291
 
        self.addCleanup(reset_values)
 
283
        self.overrideAttr(repository.InterRepository,
 
284
                          '_walk_to_common_revisions_batch_size', 1)
 
285
        self.overrideAttr(SmartServerRepositoryGetParentMap,
 
286
                            'no_extra_results', True)
292
287
 
293
288
 
294
289
class TestPushHook(TestCaseWithInterBranch):