~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_bundle.py

  • Committer: Jelmer Vernooij
  • Date: 2011-05-03 23:16:56 UTC
  • mto: This revision was merged to the branch mainline in revision 5819.
  • Revision ID: jelmer@samba.org-20110503231656-4sxm717yejm8cpuw
Add tariff test to make sure working tree isn't opened by 'bzr serve'
that simply accesses a branch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
65
65
 
66
66
 
67
67
class MockTree(object):
68
 
 
69
68
    def __init__(self):
70
69
        from bzrlib.inventory import InventoryDirectory, ROOT_ID
71
70
        object.__init__(self)
76
75
 
77
76
    inventory = property(lambda x:x)
78
77
 
79
 
    def all_file_ids(self):
80
 
        return set(self.paths.keys())
 
78
    def __iter__(self):
 
79
        return self.paths.iterkeys()
81
80
 
82
81
    def __getitem__(self, file_id):
83
82
        if file_id == self.root.file_id:
494
493
                                 % (ancestor,))
495
494
 
496
495
                # Now check that the file contents are all correct
497
 
                for inventory_id in old.all_file_ids():
 
496
                for inventory_id in old:
498
497
                    try:
499
498
                        old_file = old.get_file(inventory_id)
500
499
                    except errors.NoSuchFile: