/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to breezy/tests/test_versionedfile.py

  • Committer: Jelmer Vernooij
  • Date: 2017-06-10 00:52:08 UTC
  • mfrom: (6675 work)
  • mto: (6670.4.8 move-bzr)
  • mto: This revision was merged to the branch mainline in revision 6681.
  • Revision ID: jelmer@jelmer.uk-20170610005208-dthx80fkolfpsenj
Merge trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
94
94
        # such, it should end up in the various caches
95
95
        gen._process_one_record(record.key, record.get_bytes_as('chunked'))
96
96
        # The chunks should be cached, the refcount untouched
97
 
        self.assertEqual([('one',)], gen.chunks.keys())
 
97
        self.assertEqual({('one',)}, set(gen.chunks))
98
98
        self.assertEqual({('one',): 2, ('two',): 1}, gen.refcounts)
99
 
        self.assertEqual([], gen.diffs.keys())
 
99
        self.assertEqual(set(), set(gen.diffs))
100
100
        # Next we get 'two', which is something we output, but also needed for
101
101
        # three
102
102
        record = next(stream)
105
105
        # Both are now cached, and the diff for two has been extracted, and
106
106
        # one's refcount has been updated. two has been removed from the
107
107
        # parent_map
108
 
        self.assertEqual(sorted([('one',), ('two',)]),
109
 
                         sorted(gen.chunks.keys()))
 
108
        self.assertEqual({('one',), ('two',)}, set(gen.chunks))
110
109
        self.assertEqual({('one',): 1, ('two',): 1}, gen.refcounts)
111
 
        self.assertEqual([('two',)], gen.diffs.keys())
 
110
        self.assertEqual({('two',)}, set(gen.diffs))
112
111
        self.assertEqual({('three',): (('one',), ('two',))},
113
112
                         gen.parent_map)
114
113
        # Finally 'three', which allows us to remove all parents from the
118
117
        gen._process_one_record(record.key, record.get_bytes_as('chunked'))
119
118
        # Both are now cached, and the diff for two has been extracted, and
120
119
        # one's refcount has been updated
121
 
        self.assertEqual([], gen.chunks.keys())
 
120
        self.assertEqual(set(), set(gen.chunks))
122
121
        self.assertEqual({}, gen.refcounts)
123
 
        self.assertEqual(sorted([('two',), ('three',)]),
124
 
                         sorted(gen.diffs.keys()))
 
122
        self.assertEqual({('two',), ('three',)}, set(gen.diffs))
125
123
 
126
124
    def test_compute_diffs(self):
127
125
        vf = self.make_three_vf()