/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: Breezy landing bot
  • Author(s): Martin
  • Date: 2017-06-05 21:50:19 UTC
  • mfrom: (6656.1.3 dict_viewing)
  • Revision ID: breezy.the.bot@gmail.com-20170605215019-uw7s07tx11p194kh
Apply 2to3 dict fixer and clean up with sixish view methods

Merged from https://code.launchpad.net/~gz/brz/dict_viewing/+merge/325108

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()