~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_groupcompress.py

  • Committer: John Arbash Meinel
  • Date: 2009-03-14 16:05:43 UTC
  • mto: (3735.2.156 brisbane-core)
  • mto: This revision was merged to the branch mainline in revision 4280.
  • Revision ID: john@arbash-meinel.com-20090314160543-04i9wg8s13bjh337
A bit of reworking changes things so content is expanded at extract() time.

Show diffs side-by-side

added added

removed removed

Lines of Context:
194
194
            'gcb1z\n0\n0\n0\n0\n')
195
195
        self.assertIsInstance(block, groupcompress.GroupCompressBlock)
196
196
        self.assertEqual({}, block._entries)
 
197
        self.assertIs(None, block._content)
 
198
        self.assertEqual('', block._z_content)
 
199
        block._ensure_content()
197
200
        self.assertEqual('', block._content)
 
201
        self.assertIs(None, block._z_content)
 
202
        block._ensure_content() # Ensure content is safe to call 2x
198
203
 
199
204
    def test_from_bytes(self):
200
205
        header = ('key:bing\n'
239
244
        self.assertEqual('abcd'*10, foobar.sha1)
240
245
        self.assertEqual(0, foobar.start)
241
246
        self.assertEqual(100, foobar.length)
 
247
        self.assertEqual(z_content, block._z_content)
 
248
        self.assertIs(None, block._content)
 
249
        block._ensure_content()
 
250
        self.assertIs(None, block._z_content)
242
251
        self.assertEqual(content, block._content)
243
252
 
244
253
    def test_add_entry(self):