~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_fetch.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:
404
404
        source.inventories = versionedfile.RecordingVersionedFilesDecorator(
405
405
                        source.inventories)
406
406
        # XXX: This won't work in general, but for the dirstate format it does.
407
 
        old_fetch_uses_deltas_setting = target._format._fetch_uses_deltas
408
 
        def restore():
409
 
            target._format._fetch_uses_deltas = old_fetch_uses_deltas_setting
410
 
        self.addCleanup(restore)
411
 
        target._format._fetch_uses_deltas = False
 
407
        self.overrideAttr(target._format, '_fetch_uses_deltas', False)
412
408
        target.fetch(source, revision_id='rev-one')
413
409
        self.assertEqual(('get_record_stream', [('file-id', 'rev-one')],
414
410
                          target._format._fetch_order, True),