~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test__groupcompress.py

  • Committer: Matt Nordhoff
  • Date: 2009-06-23 05:12:07 UTC
  • mto: This revision was merged to the branch mainline in revision 4474.
  • Revision ID: mnordhoff@mattnordhoff.com-20090623051207-fksdtbzkwtnrw9dd
Update _add_text docstrings that still referred to add_text.

Show diffs side-by-side

added added

removed removed

Lines of Context:
272
272
        di = self._gc_module.DeltaIndex('test text\n')
273
273
        self.assertEqual('DeltaIndex(1, 10)', repr(di))
274
274
 
275
 
    def test_first_add_source_doesnt_index_until_make_delta(self):
276
 
        di = self._gc_module.DeltaIndex()
277
 
        self.assertFalse(di._has_index())
278
 
        di.add_source(_text1, 0)
279
 
        self.assertFalse(di._has_index())
280
 
        # However, asking to make a delta will trigger the index to be
281
 
        # generated, and will generate a proper delta
282
 
        delta = di.make_delta(_text2)
283
 
        self.assertTrue(di._has_index())
284
 
        self.assertEqual('N\x90/\x1fdiffer from\nagainst other text\n', delta)
285
 
 
286
 
    def test_second_add_source_triggers_make_index(self):
287
 
        di = self._gc_module.DeltaIndex()
288
 
        self.assertFalse(di._has_index())
289
 
        di.add_source(_text1, 0)
290
 
        self.assertFalse(di._has_index())
291
 
        di.add_source(_text2, 0)
292
 
        self.assertTrue(di._has_index())
293
 
 
294
275
    def test_make_delta(self):
295
276
        di = self._gc_module.DeltaIndex(_text1)
296
277
        delta = di.make_delta(_text2)